kaworu/octostrap3

Line numbers (at least instructions for re-enabling)

shidarin opened this issue · 4 comments

I'm tearing my hair out trying to figure out what's going wrong with line number display.

I clone octopress, resetting master to commit fe6ef74 as specified on the octopatch page. I then do the whole setup thing (gem install bundler, bundle install, rake setup, etc. etc.) Then I clone and install the octostrap3 theme.

I can write codeblocks great- but line numbers never show up. When I include a gist, the line numbers show up but are totally incorrect.

So, does octostrap just not include line numbers? I can't find any on the demo, and I can't find any on any octostrap3 blogs I've found.

Okay, apparently there shouldn't be line numbers (found the comment on on unrelated post on the octostrap blog).

But, well, that kinda sucks. Octopress is blogging for "hackers" which means a lot of us want to share code, and it's difficult without line numbers.

In sass/custom/_syntax.scss, change:

            .gutter {
                display: none;
            }

to

            .gutter {
            }

In sass/partials/_syntax.scss, (line 13ish) change

.highlight .line-numbers, .gist-file .line-numbers {
  display: none; // XXX
  text-align: right;
  font-size: 13px;
  line-height: 1.45em;
  @if $solarized == light {

to

.highlight .line-numbers, .gist-file .line-numbers {
  text-align: right;
  font-size: 13px;
  line-height: 1.45em;
  @if $solarized == light {

That will reveal line numbers, but note that this reveals the bug where gist line numbers are totally out of wack, which isn't octostrap's fault.

hi @shidarin,

Thank you for you report. When I wrote this theme I wanted to support both codeblock with line number and without. At the time, an option in codeblock to disable (or enable) line number was documented but did not work, so I (selfishly) decided to not use them. I don't know if this bug has been fixed in octopress by now.

You are right about the line number being not correctly aligned with the code, the XXX comment suggest that hidding .line-numbers is hacky. Could you give a try to a patch ? I would gladly merge a pull request that would make line numbers the default if fixed. I would then document how to hide them on the blog.

I am.. sadly unaware of if linenos is actually fixed or not. To be perfectly honest the octopress master branch is an unversioned mess. All the linenos and mark commits are in the history of the master branch, but don't seem to have any effect anymore. The commit the current master branch points to doesn't build with Jekyll when you have ANYTHING after code block start.

After struggling with trying to find a good, recent commit to base octopress off of, I gave up and built a Frankenstein off of the ancient 2.0 tag, using some of the plugins from the site-2.1 branch.

I personally have linenos and mark working, but that's only because I'm hacking together an octopress from commits around this commit.

Sorry I can't be of more help :/

Hi @shidarin

I think I've fixed the line number display. They now should be visible by default, as I agree with you that it should be the case.

For the linenos stuff I did test again and sadly it doesn't work with the latest Octopress master version (imathis/octopress@4fdae37). As a matter of fact, the start option (also documented on octopress.org) doesn't work either.

Regards,
Alex.