My Code Note Method and Standard Specification
泓熠 (HY)
Copyright © 2026, 泓熠 (HY).
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
Amendment Note in 2026: First written in 2023, amended in 2026.
Notation
- General Formula Notation
- Specific Formula Notation
- I'll add more when I have time.
Note File Format
There are some aspects should be considered for selecting note file format.
- High Generality and Compability
- It has more user and the refolve (browser / renderer) is popular.
- Open and Free (Libre) Standard
- The encoding format of files are open and free, which can't be controled by some corporations.
- Content and Format Speration
- Authors pay all attention to content without format.
- Readable;
- Readability means writting and reading efficienty.
- Considering Steaming Document and Layout Document
- Layout documents are designed for printing and reading on paper, while streaming documents are designed for reading on electronic screens.
The formats that meet the above conditions are roughly as follows:
- HTML(XHTML) + CSS
- Markdown
- AsciiDoc
- LaTeX
- EPUB
- GNU roff (groff)
- GNU Texinfo
- Org Mode for GNU Emacs
Generaal Identifier Naming Standard
- Use uppercase nameing for constants such as:
NUMBER_A;
- Use underscore naming for variables / objects / attributes such as:
my_data;
- Use hump naming for functions and methods such as:
myFunction;
- Use big hump naming (pascal naming) for classes such as:
MyClass;
- Use lowercase naming for packages and modules such as:
mypackage / mymodule;
- Use Hungray nomenclature for each variable types, which will specifiy variable type at beginning such as: Array:
a_ / Boolean value: b_ / String: s_ / Function: fn_ / Integer: i_ / Float: f_ / Object of class: m_。
Requirements for plain text file format
- The encoding format should be UTF-8.
- End of line(EOL) should be UNIX style, in which LF (U+0A) should use rather than CRLF (CRLF, U+0D & U+0A) as DOS style.
- The last line in a file should have EOL as EOF (End of File).
Requirements for plain text editor
- The editor should regard EOL as "the end of a line" rather than "start a new line", othewishse it will misunderstand there is a blank line at the end of a file because the last line in a file has EOL also.
- The editor should show the Tab (U+0009) as width of 4 spaces (U+0020).
- The editor should show all hiden symbols such as spaces, tabs, EOL, etc.
The Grammar Requirements of Code Note Method
- A space must separate the left and right sides of the annotation symbol end of line from the content.
- use tab (U+0009) for indent rather than space (U+0020).
- Add annotations end of line where need annotate, after annotation it should indent a level.
- If there are some alternative contents in this line, it should creat a new line with original indent level.
- We should indent a level when creating a new line for content in a container.
- <The alternative content insturction>, the <> indecates alternative content instruction.
Gereral Code Example with Note Format (Use "#" as Annotation Symbol End of Line)
content outside the container { # This is a container.
content in the container #
} # This is some annotations outside the container.
other content # Other contents and space end of the line.
instead_content 1 # Alternative content.
instead_content 2 # Alternative content.
instead_content a # Line continuation when creating a new line and indent, in the original code it is only one line.
instead_content b
instead_content 3
instead_content A
instead_content B
Semantic Versioning
The version number should be like 2.13.11, in thich the 1st place means main version, the 2ed place means sub version, and the 3rd place means revision version.
Update the main version number after making a non-backward-compatible update.
Update the sub version number when backward-compatible features are added.
Update the revision number after fixing non-functional issues.
When the high version number is updated, the low version number is set to 0.
- ^3.2.12
- Lock the main version number, equal to or greater than the sub version number and revision number.
- ~3.2.12
- Lock the main version and sub version, equal to or greater than the revision number.
- 3.x.x
- The wildcard which can be any number.
- < / > / <= / >= / -
- Indicates the version range.
View Semantic Versioning。
Chinese Typsetting Standard
View 中文文案排版指北。