View Issue Details

IDProjectCategoryView StatusLast Update
0006167ardourdocumentationpublic2020-04-19 20:17
Reporterskagedal Assigned Topaul  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Summary0006167: Unable to build manual from jekyll sources
DescriptionWhen trying to build the manual from the git repository at http://github.com/Ardour/manual/ (commit 0b6ad9326ccdaec578164df288c8ce6321ca67a0), using Jekyll 2.5.3, I get the following error:

simon@struts:~/projects/manual$ jekyll build
Configuration file: /home/simon/projects/manual/_config.yml
            Source: source
       Destination: /home/simon/projects/manual/_site
      Generating...
  Liquid Exception: Unknown tag 'tree' in _layouts/bootstrap.html
jekyll 2.5.3 | Error: Unknown tag 'tree'
simon@struts:~/projects/manual$

As I understand from the README.rb, 'tree' is supposed to be a tag defined by this project, but I cannot find the definition of it anywhere.
TagsNo tags attached.

Activities

skagedal

2015-02-22 19:53

reporter   ~0016364

Ok, it seems this can be solved by explicitly giving plugin path, either as command line option to jekyll build or in config.yml. I have no idea why this is necessary on my system. I attach a patch, I suppose it does no harm to others?

Anyway, now a different problem presents itself.

$ jekyll build
Configuration file: /home/simon/projects/manual/_config.yml
            Source: source
       Destination: /home/simon/projects/manual/_site
      Generating...
Error reading file _manual/./23_video-timeline.html: undefined method `in_source_dir' for nil:NilClass
jekyll 2.5.3 | Error: undefined method `frontmatter_defaults' for nil:NilClass
$

I'll look further at this...

2015-02-22 19:54

 

0001-Add-explicit-path-for-plugins.patch (476 bytes)   
From 15a4242e12fd807357286c7848ba2629c794fce4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20K=C3=A5gedal=20Reimer?= <skagedal@gmail.com>
Date: Sun, 22 Feb 2015 20:45:52 +0100
Subject: [PATCH] Add explicit path for plugins.

Partially fixes bug #6167
---
 _config.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/_config.yml b/_config.yml
index 0ffca95..fdfaea2 100644
--- a/_config.yml
+++ b/_config.yml
@@ -1 +1,2 @@
 source: source
+plugins: ./_plugins
-- 
2.1.0

skagedal

2015-02-22 20:17

reporter   ~0016365

Running "jekyll build --trace" yields the following:

$ jekyll build --trace
Configuration file: /home/simon/projects/manual/_config.yml
            Source: source
       Destination: /home/simon/projects/manual/_site
      Generating...
Error reading file _manual/./23_video-timeline.html: undefined method `in_source_dir' for nil:NilClass
/var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/page.rb:36:in `block in initialize': undefined method `frontmatter_defaults' for nil:NilClass (NoMethodError)
    from /home/simon/projects/manual/_plugins/manual.rb:34:in `yield'
    from /home/simon/projects/manual/_plugins/manual.rb:34:in `block in traverse'
    from /home/simon/projects/manual/_plugins/manual.rb:29:in `map'
    from /home/simon/projects/manual/_plugins/manual.rb:29:in `traverse'
    from /home/simon/projects/manual/_plugins/manual.rb:101:in `block in generate'
    from /usr/lib/ruby/2.1.0/tmpdir.rb:88:in `mktmpdir'
    from /home/simon/projects/manual/_plugins/manual.rb:99:in `generate'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:280:in `block in generate'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:279:in `each'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:279:in `generate'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:50:in `process'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/command.rb:28:in `process_site'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:56:in `build'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:34:in `process'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
    from /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
    from /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
    from /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
    from /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
    from /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
    from /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
    from /usr/local/bin/jekyll:23:in `load'
    from /usr/local/bin/jekyll:23:in `<main>'
$

2015-02-23 08:26

 

0002-Make-sure-Manual-module-has-access-to-site.patch (1,555 bytes)   
From 5ca8e50b016be720f769be6b06ec77d94023c4b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20K=C3=A5gedal=20Reimer?= <skagedal@gmail.com>
Date: Mon, 23 Feb 2015 09:24:38 +0100
Subject: [PATCH] Make sure "Manual" module has access to "site"

A hack for bug #6167.
---
 _plugins/manual.rb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/_plugins/manual.rb b/_plugins/manual.rb
index 2a5d905..71a82b5 100644
--- a/_plugins/manual.rb
+++ b/_plugins/manual.rb
@@ -7,6 +7,10 @@ module Manual
 
   DIRECTORY_ENTRIES = {}
 
+  def self.setsite(s)
+    @@site = s
+  end
+
   def self.traverse_data(entries, directory_sort = false, paths = [], key_paths = [], &block)
 
     entries.map do |entry|
@@ -69,7 +73,7 @@ module Manual
     def self.extract_data(filename)
       if File.exists?(filename) and !File.directory?(filename) and first3 = File.open(filename) { |fd| fd.read(3) } and first3 == '---'
         blah = filename.sub(/^_manual\//,'')
-        page = Jekyll::Page.new(@site, '_manual', File.dirname(blah), File.basename(blah))
+        page = Jekyll::Page.new(@@site, '_manual', File.dirname(blah), File.basename(blah))
         page.data
       else
         {}
@@ -92,6 +96,8 @@ module Manual
 
       manual_dir = '_manual'
 
+      Manual.setsite(site)
+
       # now we need to turn our raw input files into something for jekyll to process
       # everything is in a directory with it's name and all content is in index.html files
       # the tmpdir gets removed at the end of this block automatically
-- 
2.1.0

skagedal

2015-02-23 08:30

reporter   ~0016366

I got some assistance at https://github.com/jekyll/jekyll-help/issues/275 and came up with a hack, see patch 0002. However, now a new problem surfaces:

$ jekyll build
Configuration file: /home/simon/projects/manual/_config.yml
            Source: source
       Destination: /home/simon/projects/manual/_site
      Generating...
Error reading file _manual/./23_video-timeline.html: No such file or directory @ rb_sysopen - /home/simon/projects/manual/source/_manual/23_video-timeline.html
Error reading file /tmp/d20150223-29293-ispu2y/video-timeline/index.html: No such file or directory @ rb_sysopen - /home/simon/projects/manual/source/tmp/d20150223-29293-ispu2y/video-timeline/index.html
Error reading file _manual/./01_welcome-to-ardour.html: No such file or directory @ rb_sysopen - /home/simon/projects/manual/source/_manual/01_welcome-to-ardour.html
Error reading file /tmp/d20150223-29293-ispu2y/welcome-to-ardour/index.html: No such file or directory @ rb_sysopen - /home/simon/projects/manual/source/tmp/d20150223-29293-ispu2y/welcome-to-ardour/index.html
Error reading file _manual/./22_using-control-surfaces.html: No such file or directory @ rb_sysopen - /home/simon/projects/manual/source/_manual/22_using-control-surfaces.html
Error reading file /tmp/d20150223-29293-ispu2y/using-control-surfaces/index.html: No such file or directory @ rb_sysopen - /home/simon/projects/manual/source/tmp/d20150223-29293-ispu2y/using-control-surfaces/index.html

... and so on for every file in the manual.

paul

2015-02-23 22:13

administrator   ~0016367

(From Nick Sellen, original author of the manual system):

First bug report is a breaking change within Jekyll 1.x. Next bug is a breaking change between 1.x and 2.x.

bug 1 fix (as the guy discovered):
-----------------------------------------

mv _plugins source


bug 2 fix (peg version of jekyll using bundler):
-----------------------------------------

cat <<-EOF > Gemfile
source 'https://rubygems.org'

gem 'jekyll', '~>1'
EOF
bundle install
bundle exec jekyll build


... and yes it looks like it could do with a bit of tidying up, it's a bit hard to make sense of all the code, it's sort of hacked into jekyll's plugin system (to be able to get things like the child pages in a tag on a given page). I'd be happy to update it for Jekyll 2 at some point if it seems a useful thing to do. I suspect it's not such a big job...

skagedal

2015-02-24 11:46

reporter   ~0016368

Thanks Nick!

In the process of trying to hunt down these bugs, I've come to think that there is a simpler way of achieving what manual.rb does by moving the manual html files into the source directory and let them be handled with the usual Jekyll processing chain. A plugin then needs to take care of tweaking the permalinks for each page so that the same URL structure is kept - this can be done by modifying Jekyll::Page.permalink - and the "trees"/"children" plugin snippets can be implemented by looking in site.pages.

I realize that fixing the existing code might be a smaller task, but if you don't mind I'd like to have a go at this since I think it would be fun to do (I don't mind if you don't end up using my code). Can hopefully find hacking time during the following week or two.

Regards, Simon

skagedal

2015-03-09 20:25

reporter   ~0016406

Ok, so here's a pull request: https://github.com/Ardour/manual/pull/16

Code size is more than cut in half and I believe it to be less complicated than the previous solution. It now works as described in README.md, with a fresh Jekyll from pip. (Who knows what'll break in the soon to be released Jekyll 3.0.0, though...) There's also a separate commit with a feature that I was missing when reading through the manual, a previous/next pager.

skagedal

2015-03-10 23:07

reporter   ~0016408

Heh, "fresh jekyll from pip" should of course be "from gem". Pythonic slip.

So here's a solution without Jekyll: https://github.com/Ardour/manual/pull/17

paul

2015-04-05 20:45

administrator   ~0016551

pull request merged and pushed to manual.ardour.org

system

2020-04-19 20:17

developer   ~0023396

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2015-02-14 23:00 skagedal New Issue
2015-02-22 19:53 skagedal Note Added: 0016364
2015-02-22 19:54 skagedal File Added: 0001-Add-explicit-path-for-plugins.patch
2015-02-22 20:17 skagedal Note Added: 0016365
2015-02-23 08:26 skagedal File Added: 0002-Make-sure-Manual-module-has-access-to-site.patch
2015-02-23 08:30 skagedal Note Added: 0016366
2015-02-23 22:13 paul Note Added: 0016367
2015-02-24 11:46 skagedal Note Added: 0016368
2015-03-09 20:25 skagedal Note Added: 0016406
2015-03-10 23:07 skagedal Note Added: 0016408
2015-04-05 20:45 paul Note Added: 0016551
2015-04-05 20:45 paul Status new => resolved
2015-04-05 20:45 paul Resolution open => fixed
2015-04-05 20:45 paul Assigned To => paul
2020-04-19 20:17 system Note Added: 0023396
2020-04-19 20:17 system Status resolved => closed