Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: documentation with sphinx #332

Merged
merged 17 commits into from
Nov 27, 2024
Merged

feat: documentation with sphinx #332

merged 17 commits into from
Nov 27, 2024

Conversation

peter-jerry-ye
Copy link
Collaborator

No description provided.

Copy link

peter-jerry-ye-code-review bot commented Nov 20, 2024

From the provided git diff output, it appears that a new documentation framework for MoonBit, based on Sphinx, is being set up. Here are some observations and suggestions based on the changes:

  1. Lexer Configuration for MoonBit Syntax Highlighting:

    • The lexer.py file introduces a custom lexer for MoonBit (MoonBitLexer) and registers it for both moonbit and mbt file extensions.
    • Suggestion: Ensure that the regular expressions used in the lexer accurately capture the syntax of MoonBit, including comments, keywords, literals, and operators. This will provide proper syntax highlighting in the generated documentation.
  2. Documentation Configuration:

    • The conf.py file sets up the Sphinx documentation configuration, including project information, extensions, and paths.
    • Suggestion: Verify that all necessary Sphinx extensions are included, especially those for custom lexers and parsers. Also, ensure that the templates_path and exclude_patterns are correctly set up to avoid including unwanted files in the documentation build.
  3. Index and Language Documentation:

    • The index.md file serves as the main entry point for the documentation, linking to other sections like language, tutorial, and toolchains.
    • Suggestion: Ensure that the structure of the documentation is clear and logical, with easy navigation between different sections. Consider adding a table of contents or navigation sidebar for better user experience.
  4. Language Grammar Documentation:

    • The grammar.md file includes a simple example of MoonBit code.
    • Suggestion: Expand the grammar documentation to cover more aspects of the language, including function definitions, variable bindings, control structures, and data types. This will provide a comprehensive reference for users.
  5. Translation Setup:

    • The locales directory contains .po files for Chinese translations, indicating support for localization.
    • Suggestion: Review the translation files to ensure they are complete and accurately translated. Consider using a translation management tool if the documentation grows larger and requires more languages.
  6. Tutorial and Toolchains Documentation:

    • The tutorial and toolchains directories include markdown files for tutorials and toolchain usage guides.
    • Suggestion: Ensure that the tutorials are step-by-step and beginner-friendly, covering basic to advanced topics. For toolchains, provide detailed instructions on installation, configuration, and usage.
  7. Makefile and Batch Script for Building Documentation:

    • The Makefile and make.bat files provide commands for building the Sphinx documentation.
    • Suggestion: Test the build scripts on different platforms (Linux, macOS, Windows) to ensure they work as expected. Consider adding documentation on how to use these scripts for building the documentation.

Overall, the setup looks comprehensive, but thorough testing and review are necessary to ensure that the documentation is accurate, complete, and user-friendly.

@bobzhang
Copy link
Collaborator

@peter-jerry-ye it failed when I tried make latexpdf

@peter-jerry-ye
Copy link
Collaborator Author

@peter-jerry-ye it failed when I tried make latexpdf

A path to image was incorrect. It is now corrected.

@peter-jerry-ye peter-jerry-ye marked this pull request as ready for review November 27, 2024 06:51
@peter-jerry-ye peter-jerry-ye merged commit eead60b into main Nov 27, 2024
2 checks passed
@peter-jerry-ye peter-jerry-ye deleted the zihang/next branch November 27, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants