progrium / viewdocs

Read the Docs meets Gist.io for simple Markdown project documentation

Home Page:http://viewdocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proposal: Support for page specific CSS classes

fgrehm opened this issue · comments

I've been wondering if it would make sense to have some sort of variable with the current page path for us to use on our template's <body> to have a better control of the styles / JS applied to each page.

I was thinking about some sort of {{PAGE_CLASSES}} variable that gets the current markdown document path value hitting some page. We'd just need to take into consideration paths with slashes and I think we can either make it 2 separate classes or just replace the /s with -s.

Just to make it easier to understand, http://progrium.viewdocs.io/viewdocs/development would set {{PAGE_CLASSES}} to development, while http://progrium.viewdocs.io/viewdocs/development/some-section could set {{PAGE_CLASSES}} to either development-some-section or development some-section

@progrium, I hope that's clear enough and please LMK if you'd accept a PR for that :-)