How to customize HTML for tabs, TOC, etc.

41 views
Skip to first unread message

Juliette

unread,
Oct 3, 2016, 4:18:26 AM10/3/16
to gitit-discuss
Hi,

I just discover the project and I like it a lot.

I customized some parts of the templates and the css, but i didn't find how to customize the HTML code for tabs or the div TOC.

Is it possible ?

Thank you for your answer,

Juliette

Freiric Barral

unread,
Oct 3, 2016, 9:31:15 AM10/3/16
to gitit-...@googlegroups.com
Hi Juliette,

I would say, you cannot customize the html of tabs or toc without modifying the code.
The html code for tabs is set together in Network.Gitit.Layout.filledPageTemplate.
The html code for the toc is computed in pandoc, in Text.Pandoc.Writers.HTML.pandocToHtml (delegating to tableOfContents).
Just out of curiosity, what would you like to do?

Thanks,

Freiric.

--
You received this message because you are subscribed to the Google Groups "gitit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gitit-discus...@googlegroups.com.
To post to this group, send email to gitit-...@googlegroups.com.
Visit this group at https://groups.google.com/group/gitit-discuss.
For more options, visit https://groups.google.com/d/optout.

0xD2BE32D5.asc

Juliette

unread,
Oct 3, 2016, 9:41:38 AM10/3/16
to gitit-discuss

Firstofall, thank you for your answer. 

I would like to translate tabs in french for the first part. Then I would like to remove the div TOC from the content, to put it on the right of the page. 
The sitenav is on the left, and I want to place the TOC on the right. 

Thanks,

Juliette

Freiric Barral

unread,
Oct 3, 2016, 11:34:48 AM10/3/16
to gitit-...@googlegroups.com
Hi,

To move the TOC from content to the right of the page I guess the simplest would be to use javascript (maybe css?).
You would need to add a call to a script in the main page.
To do this you can copy the template from data/templates/page.st to your template directory, and modify this file to call a javascript script. Add something like "<script src="/myscript.js" type="text/javascript"></script>" at the end of the template.
You can then add the script itself in your static directory.

For the translation you may translate the source directly, use more javascript magic or contribute a more elaborate solution...

I created a frenchGitit branch in my gitit repo, where I translated the hardcoded tab title, and used a script to do minor arrangement of the layout. Although this is not quite what you want you may take inspiration from it.

Thanks,

Freiric.
0xD2BE32D5.asc

Juliette

unread,
Oct 4, 2016, 3:20:19 AM10/4/16
to gitit-discuss
Hello !

I'm gonna watch your frenchgitit branch to see what you did. For the TOC div, my team and I decided to give up because we don't have enough time to do it. 

Thank you for your answers !

Juliette
Reply all
Reply to author
Forward
0 new messages