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
Enhancement: in docs move global options to a separate file #1852
Comments
I'm in favour of this enhancement. We may want to look at https://github.com/RedisLabs/mkdocs-include as well. |
Not familiar with this but let me check. |
Good find @garrytrinder. Let's give it a try and see if we can get it to work. |
@waldekmastykarz @garrytrinder markshell@1.3.0-alpha0 should now support the externals. ATM: I only implemented this form Source file
# Heading Level 1 of main file
{!included_file.md!}
## Heading Level 2 of main file
{!included_file.md!} I can add the other version too fi needed. If you really favour the other syntax I need to update the regex. |
Awesome! Thank you for such a quick turnaround. We'll give it a go asap 🚀 |
It seems that we can use the syntax of the PyMdown snippets extension, which is already available in our infrastructure:
@StfBauer it would be awesome if you could add support for this import notation in markshell. The path is tricky as it's relative to where the As soon as this is supported in markshell, we can go an update our docs 💪 |
OMG @waldekmastykarz that is pretty tricky cause I don't have start and end for this definition. It is a hell of a syntax - might node-gyp help. I take a look. |
How about we'd start with supporting just one line with a regex, where the line must end with the quote, something like |
Yeah that is no bigggy for my ;) |
Ok so I changed the code and after this comment I will publish the new version of the package. {! helloworld.md !}
--8<-- helloworld.md Both syntax should include the external files. You never know. 🤷♂️ Thank you for the head start with the regex I had to modify it a bit and should now be able to include any other syntax with a minimum effort. Types are also updated because there is a setting as requested that will be for now used in the PyMDown exclusively. theme.includePath = path.join(__dirname, '../samples/'); Current version 1.3.1 with that external support. Ladies and gents, update your engines. |
Hero! I'll give it a try asap. Thank you very much! 👏 |
@StfBauer after upgrading to markshell@1.3.1, here is what I've found out:
FWIW: I'm testing it on this branch https://github.com/waldekmastykarz/cli-microsoft365/tree/external-global-docs |
@waldekmastykarz 🤦♂️
1.3.2 looks more promising now I am just wondering about the docs/docs but I guess this is something you will fix right? |
As for not specifying the |
Exactly and it is only used now for PyMDown. The only thing I could do to have the same treatment like the other plugin, when not specified. Not sure. Case 1: not specified let baseDir = path.dirname(filepath); // file of markdown file Case 2: specified let baseDir = this._theme.includePath // file in config |
OK, so perhaps what was breaking the help is the fact that we had PyMDown include markers but were missing the necessary configuration. What would be helpful in such case to return a clearer error message what's wrong. Not rendering the whole help altogether is an indication that something is wrong somewhere but it's not very clear what's wrong exactly. 😊 |
What are you thinking @waldekmastykarz? I could stack all errors instead of raising the errors and put them up front or at the end of the content? Would that help? |
Absolutely! As long as they're displayed, it'll help a lot ❤️ |
OK if you insist 👍 |
Including contents from external files works like a charm. I'll wait with submitting a PR until we sorted out StfBauer/markshell#23 so that we can do them in one go. |
Issue confirmed fixed in markshell@1.3.7. We can proceed with this issue. Thanks @StfBauer ❤️ |
Recently, we have changed the CLI to always use docs from .md files. This lowers the effort in writing docs and simplifies the maintenance since we have a single version of docs for each command. We could simplify things further by extracting global options, which are the same for all commands, and storing them in a single file so that we don't need to repeat them in every file and can maintain them consistently in a single place for all commands.
For this to work, we need to check two things:
The text was updated successfully, but these errors were encountered: