-
Notifications
You must be signed in to change notification settings - Fork 486
Not able to use a custom theme / docs unclear on how to do it. #849
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
Comments
Hello! Re: main question about modifying themes:
That said, this is all relative to HTML themes, not Markdown. As it stands, you could do a ground-up theme that generates Markdown, but that isn't the main intent of the theming code - themes are intended to be for HTML, which has more opinionated style decisions, rather than Markdown, for which we try to make the defaults great (and also Markdown is generated from an AST, not through templating like in most themes). Is there anything in the Markdown theme that you specifically want to get improvements over? |
I ran into this also. It would be great there were a separate repo with the default theme already built. You could point to it in the docs and say "To create a custom theme, download this and modify it." |
@tmcconechy fyi, I also had to replace |
cc @gr2m who is trying out documentationjs for GitHub's new JS Octokit. |
I am having a similar issue, although I have followed the instructions in this issue up to this point:
It creates documentation without error, but it doesn't look like the theme here. Instead, it looks exactly the way it would look if I were to omit On a related note, can anyone tell me why it lists the name of the function twice? thanks! |
My command is Without seeing the file you documented, i think one is the file name and one is the constructor signiture. But you should be able to modify that by changing the index._ and index.js to your needs. |
Unfortunately adding double dashes and spelling everything out had no effect :( |
Ok. Feeling a little dumb. So, the command is working. The problem is that the link in the README says that the example is built with the default template, but looking at the source code it doesn't seem to be the case. Can anyone point me to the theme that is used in the html example in the README? thanks! OR explain to me how to nest namespaces in the sidebar default theme... UPDATE: I figured out how to nest namespaces, but would still like to get my hands on that theme :) |
Amen to what @jmbothe said. The themes are incredibly confusing. There doesn't seem to be a good list of available themes and the example http://documentation.js.org/html-example/ is clearly not generated using the default theme. @tmcw could you possibly let us know / document the theme used in that example? Even better would be to describe the command used to generate that particular example |
The Sorry about this, but referring to my reply on the other thread - my computer time is heavily invested in building a startup and I need to spend more time with my bonsai and other hobbies. Please, if you/your company relies on this thing, pay it forward by helping out / digging for answers in the code / submitting PRs, because open source is/can be a team sport. |
I dont have time just right now for a PR either but if this helps the way that helped me was to figure out that if you look into index.js in the theme. Consider that "root" of the theme. You can remove and add in JS and stuff to change the data and spit it out in whatever format you like. This happens to use underscore templates. But in that code its actually rendering the templates in the in this js. So essentially you can totally do what you want in this file, make it spit out html any way you like. I saw these examples as well (some older / different API versions) but you can see in the mapbox one they wanted react components instead so changed index.js around. https://github.com/documentationjs/documentation/tree/master/src/default_theme |
Posting in case a version of myself stumbles upon this issue like I did.... I just wanted to change some very small aspects of the styling for how the HTML pages were rendered. The default instructions for doing that seemed complicated. This is also reflected in the multiple issues on this. I appreciate it is hard, or maybe even impossible, to create a way to do styling that is both easy to understand and covers all the needs of this problem space. For my simple changes to an html page, I found what worked for me was just putting a My code looks like this:
To my surprise, this let me change any of the default styling I tried to change. Easy I suspect there's things it doesn't work out well for...and it certainly won't work for markdown styling, but it worked for my small changes to a single html page and was way easier than the default instructions for how to change the theme. |
How exactly does one make a custom theme work: I tried initially to
documentation build --format html --theme docs/_theme --output docs/api/
I get an error:
/Users/tmcconechy/Dev/4.3.1/docs/_theme/index.js:22 comments: Array<Comment>, ^ SyntaxError: Unexpected token : at Object.exports.runInThisContext (vm.js:78:16)
Tried beta 14 and now 18 to be sure. How does one succeed in getting it work with a theme?
Specifically i want to modify the markdown my usually command is:
documentation build myfile.js -f md --theme docs/_theme -o myfile.md
Theme is ignored in this scenario as well.
Was hoping if i point it at a theme it would use that before generating the MD as per https://github.com/documentationjs/documentation/blob/master/docs/THEMING.md
The text was updated successfully, but these errors were encountered: