-
-
Notifications
You must be signed in to change notification settings - Fork 884
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
Generate config docs from code #1786
Conversation
5169eb8
to
6d29cec
Compare
Nice, this is a good idea. So this would replace us directly linking to |
My plan is to auto-generate this config documentation as part of the lemmy-docs build, and include it there. Then we can remove all the values and comments from config/config.hjson in the repo root, only leaving whats necessary to make |
6d29cec
to
c66a792
Compare
c66a792
to
73483eb
Compare
Upstream release 0.10 is out, so this is ready to merge now. Edit: CI failed because of this: anixe/doku#11 |
use tokio::sync::Mutex; | ||
|
||
embed_migrations!(); | ||
|
||
#[actix_web::main] | ||
async fn main() -> Result<(), LemmyError> { | ||
let args: Vec<String> = env::args().collect(); | ||
if args.len() == 2 && args[1] == "--print-config-docs" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's pry better than -h.
these aren't command line things anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nm
73483eb
to
9177b62
Compare
Updated, builds fine on stable locally. |
This is pretty much ready to merge now, only waiting for upstream to make a new release. Output looks like the following, which we can include directly in the documentation. It is json (which is also valid hjson), but I plan to rewrite it to the same format used in our config.hjson (remove commas and quotes, change comments to # etc).