fniessen / org-html-themes

Transform your Org mode files into stunning HTML documents in minutes with our Org mode HTML theme. Elevate your productivity and impress your readers! #orgmode #html #theme #productivity #design

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bigblow: Tabs aren't created unless a title is specified

player1537 opened this issue · comments

Just figured I'd add this here in case someone else runs into this issue. It doesn't necessarily need to be fixed, just maybe documented in the readme.

When exporting using the Bigblow style, the tabs for all the different sections won't be exported if the document is missing a #+TITLE directive. This is because in bigblow.js, in the function tabifySections(), the last step is to find an element with class "title" and add the tabs to it, but when no title is specified, that element isn't created.

I'm using the newest org-mode (version 8.3.1, from ELPA) and the most recent clone of this repository.

To reproduce: Make a new directory, create an org file, and clone this repository. Then fill the org file with:

#+TITLE: Required title
#+OPTIONS: html-scripts:nil html-style:nil

#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="org-html-themes/styles/bigblow/css/htmlize.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="org-html-themes/styles/bigblow/css/bigblow.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="org-html-themes/styles/bigblow/css/hideshow.css"/>

#+HTML_HEAD: <script type="text/javascript" src="org-html-themes/styles/bigblow/js/jquery-1.11.0.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="org-html-themes/styles/bigblow/js/jquery-ui-1.10.2.min.js"></script>

#+HTML_HEAD: <script type="text/javascript" src="org-html-themes/styles/bigblow/js/jquery.localscroll-min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="org-html-themes/styles/bigblow/js/jquery.scrollTo-1.4.3.1-min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="org-html-themes/styles/bigblow/js/jquery.zclip.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="org-html-themes/styles/bigblow/js/bigblow.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="org-html-themes/styles/bigblow/js/hideshow.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="org-html-themes/styles/lib/js/jquery.stickytableheaders.min.js"></script>
* Header
** Subheader
   Content

   More content
** Subheader 2
   Please?

* Second
** Such Wow
   contnet

** super whoa
   mkksks

If you export this to HTML, the tabs will work correctly, but if you remove the #+TITLE line, they will not.

I thought that, when there was no explicit #+TITLE, Org inserted the file name as title, during the export. Isn't that true (anymore)?

@player1537 thanks! I encountered this issue as well, and adding an explicit #+TITLE: heading fixes the broken javascript/tabs at the top.

This is indeed something that changed. The org-mode site lists as one of the incompatible changes for version 8.3 (see http://orgmode.org/Changes.html):

No default title is provided when TITLE keyword is missing

Skipping TITLE keyword no longer provides the current file name, or buffer name, as the title. Instead, > simply ignore the title.

I would like to have this fixed (it would be annoying to have to add titles to every file I export), and might look into it myself later.

One solution is the following change in the definition of tabifySections in bigblow.js (which just leaves out any title and puts the tabs on the top of the screen):

// insert tabs menu after title (`h1'), or at the beginning of the content.
    if($('.title').length !== 0) {
        $('.title').after(tabs);
    }
    else {
        $('#content').prepend(tabs);
    }

Should I make this into some kind of proposed commit? (I'm new to GitHub.)

@Nielius Thanks for having looked into this, and for providing a fix. No need to make a PR (unless you want that commit to list you as the author -- which is perfectly acceptable!); otherwise, I'll simply copy/paste it...

In that case, please go ahead and copy/paste. I'll have to read about how pull requests work another time.

DONE.

Thanks!