-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Documentation html output enhancements #7034
Conversation
Since Nix/NixOS/Nixpkgs manuals are on white backgroud, I'd say we use github colors for now. |
Also, do not highlight, or highlight properly output messages which are using asymmetric quotation marks. http://nslqqq.github.io/nixpkgs/sec-configuration-syntax.html#sec-configuration-file |
Same page, add support for multi-line strings.
|
10ddc8e
to
78d3230
Compare
@domenkozar , @nbp |
+1, except one-page html (that probably needs a bit more discussion). |
@@ -66,7 +66,7 @@ instance, if two modules define | |||
<command>nixos-rebuild</command> will give an error: | |||
|
|||
<screen> | |||
The unique option `services.httpd.adminAddr' is defined multiple times, in `/etc/nixos/httpd.nix' and `/etc/nixos/configuration.nix'. | |||
The unique option 'services.httpd.adminAddr' is defined multiple times, in '/etc/nixos/httpd.nix' and '/etc/nixos/configuration.nix'. |
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.
This is incorrect, because the original quotes are the actual output of that command. So please don't change the quoting style.
Where does |
Attribute paths are not highlighted correctly - only the last element is coloured (e.g. in |
@edolstra i got it from https://highlightjs.org/download/ , Custom packages section. Building it will require nodejs(http://highlightjs.readthedocs.org/en/latest/building-testing.html). |
That's how I wrote the highlighter for highlight.js - we can change that for the next version if wanted. I find it nice to highlight only the last option (took the idea from vim highlighter). |
I updated asymmetric quotes thing, these snippets are now ignored. |
What do you think about highlightjs script itself though? Wouldn't it be better to depend on nodejs and generate&minify it on the fly? |
Why would we? We only need to update if Nix highlighter changes. I'd only add docs to describe how to update highlight.js |
Well, i don't know, but it seems to be nice thing to do, and its in nix spirit. We use nix to build docs anyway. Now its simpler, but a bit ugly in my opinion. Also that way it will be kinda self documented. |
9a36f94
to
00637d8
Compare
I separated options and manual as discussed in #7607 |
@domenkozar @nmikhailov Can we rebase this work and get it merged? |
Yeah I'm planning to do that for 16.03 (but it's low priority) |
It took exactly three years, but I've merged a PR adding syntax highlighting. Thank you for providing the base on which I implemented #37901. |
See #4901
All themes are there, so you can test them out. Some of them don't play with nix nicely. (eg. some text is unreadable on http://nmikhailov.github.io/nixpkgs/sec-writing-modules.html).Themes list & preview: https://highlightjs.org/static/demo/
Documentation preview: http://nmikhailov.github.io/nixpkgs
cc @domenkozar