Formatting guidelines

Formatting guidelines help us to ensure that code is consistent, more readable, well-formatted which can enhance the quality and effectiveness of communication.

It is important for creating maintainable, efficient, and collaborative codebases.

Best Practices

80-char: 80 char in text editor
80-character word wrapping is a useful practice that can not only improve the readability, consistency, compatibility, accessibility, formatting of written documents, but also the portability as it is more likely to work across editors.
Example:
Shortcut keys to Wrap Paragraph at Ruler in Sublime Text
  • MacOS: Cmd + Option + Q
  • Windows: Alt + Q
When Paragraph is not wrapped at ruler:
When Paragraph is wrapped at ruler:
list-indentation: Consistent markdown list indentation while wrapping
Indent wrapped lines in markdown lists by the same number of spaces as the first character of the previous line, excluding any special characters.
Not Recommended
Recommended
section-gap: One line space between two sections
Adding one line space between sections in a document can improve it’s readability and make it easier for readers to distinguish different parts of the content.
Not recommended
-- component planning:
-- ftd.row:
margin-top.px: 26
padding-left.px: 50
width.fixed.px: 1400
height: fill-container
-- end: ftd.row:
-- end: planning
Lang:
ftd
Recommended
-- component planning:

-- ftd.row:
margin-top.px: 26
padding-left.px: 50
width.fixed.px: 1400
height: fill-container

-- end: ftd.row:

-- end: planning
Lang:
ftd
colon-after-space: One char space after :
The convention of adding one character space after a colon in written language is used to improve the readability of the text and make it easier for readers to distinguish between the preceding textand theinformation that follows`.
Not recommended
-- ftd.text:Hello
Lang:
ftd
Recommended
-- ftd.text: Hello
Lang:
ftd
component-gap: 10 line space between two components
The convention of adding 10 line spaces between two components in a document is a formatting technique used to create a clear visual separation and help organize the content for easier reading and comprehension.
Not recommended
-- component c1:

content of component goes here

-- end: c1

-- component c2:

content of component goes here

-- end: c2
Lang:
ftd
Recommended
-- component c1:

content of component goes here

-- end: c1










-- component c2:

content of component goes here

-- end: c2
Lang:
ftd
end-line: ensure a document ends with a trailing new line

It is done to ensure that the last line of code in the file does not end without a newline.

This is because some programming languages or tools might interpret the lack of a newline character as an error or warning, and it can also cause problems when different code files are merged or concatenated. Therefore, adding a newline at the end of the document is a good practice to ensure consistent behavior across different tools and systems.
Not recommended
-- ds.page: Page 1

content goes here.

-- end: ds.page
Lang:
ftd
Recommended
-- ds.page: Page 1

content goes here.

-- end: ds.page

Lang:
ftd
space-around-expression: One char space at the start and end of conditional expression

The convention of including a single space character before and after a conditional expression is a common coding style that helps to make the code more readable and easier to understand.

Including these spaces is not strictly necessary for the code to function correctly, but it is considered good coding practice and can help make the code easier to maintain and modify in the future.
Not recommended
-- integer num: 1

-- ftd.text: Number is 1
if: {num == 1}
Lang:
ftd
Recommended
-- integer num: 1

-- ftd.text: Number is 1
if: { num == 1 }
Lang:
ftd
space-before-emoji: One char space before emoji

Emoji are often considered as part of text in modern communication, and it is essential to give proper formatting and spacing to ensure clear and effective communication. When using an emoji after a word, it is recommended to treat it as a separate word and leave a one-character space before the emoji.

Just as we give space between two different words, it is advisable to treat words followed by emojis as two separate entities to maintain clarity and effective communication.
Not recommended
;; -------- Example 1 --------

-- ds.page: Formatting🚧

;; -------- Example 2 --------

-- fastn.sitemap:

# Guidelines🚧

## Formatting🚧

- Space before emoji🚧: /url/
Lang:
ftd
Recommended
;; -------- Example 1 --------

-- ds.page: Formatting 🚧

;; -------- Example 2 --------

-- fastn.sitemap:

# Guidelines 🚧

## Formatting 🚧

- Space before emoji 🚧: /url/
Lang:
ftd

Support fastn!

Enjoying fastn? Please consider giving us a star ⭐️ on GitHub to show your support!

Getting Help

Have a question or need help?

Visit our GitHub Q&A discussion to get answers and subscribe to it to stay tuned.

Join our Discord channel and share your thoughts, suggestion, question etc.

Connect with our community!

Found an issue?

If you find some issue, please visit our GitHub issues to tell us about it.

Join us

We welcome you to join our Discord community today.

We are trying to create the language for human beings and we do not believe it would be possible without your support. We would love to hear from you.
Copyright © 2023 - FifthTry.com