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

Out of line documentation and examples? #88

Open
jaskij opened this issue Jul 11, 2024 · 5 comments
Open

Out of line documentation and examples? #88

jaskij opened this issue Jul 11, 2024 · 5 comments

Comments

@jaskij
Copy link

jaskij commented Jul 11, 2024

To quote README.md:

Out-of-line: Many tools rely on documentation placed inline within source as long-form comments. While these seem appealing at first blush, they suffer from two big drawbacks. First, there is nothing keeping the comments from falling out of sync from the elements they document. Secondly (and ironically), experienced users of these libraries eventually find inline documentation to be more of a distraction than a help, cluttering code with comments they no longer read.

If I am understanding this correctly, it is possible to have documentation source in a file separate from the code? This feature does not seem to documented in any way, and I also couldn't find any examples.

@fosterbrereton
Copy link
Contributor

it is possible to have documentation source in a file separate from the code?

Yes- this is one of the main features of Hyde. The tool is a C++ compiler that produces documentation (instead of an executable). This documentation takes the form of dozens of Markdown-based files (with YAML front-matter). The files live externally to the source code, but are kept in sync with the source code by successive runs of Hyde. Developers can add more documentation to the files Hyde maintains, and the tool will preserve that documentation as well.

@fosterbrereton
Copy link
Contributor

fosterbrereton commented Jul 11, 2024

As far as examples, here is a sample website built with the documentation Hyde produces (using this build script) from the example files in the Hyde repo.

@jaskij
Copy link
Author

jaskij commented Jul 11, 2024

@fosterbrereton all those files have the documentation inline, in the code, though.

Perhaps we have different understandings what "separate from the code" means here?

@sean-parent
Copy link
Contributor

sean-parent commented Jul 12, 2024 via email

@jaskij
Copy link
Author

jaskij commented Jul 12, 2024

Thank you @sean-parent , this is exactly the kind of example I was looking for. Knowing what to look for, I was also able to find docs/libraries in this repository, which seems to go together with the examples in test_files/.

The one question I still have is how do those paths and file names work together. Probably something I'd be able to figure out once I get around to actually testing hyde.

Leaving this issue open because does not seem to be documented in hyde itself.

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

No branches or pull requests

3 participants