Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 28 09:50
    ddfreyne commented #1544
  • May 28 09:34

    ddfreyne on 4.12.2

    (compare)

  • May 28 09:34

    ddfreyne on main

    Add release notes for 4.12.2 Set version to 4.12.2 (compare)

  • May 28 09:15
    ddfreyne closed #1544
  • May 28 09:14
    ddfreyne commented #1544
  • May 28 09:13

    ddfreyne on main

    Drop support for Ruby 2.5 (EOL) Merge branch 'drop-ruby-2-5' in… Add video/@poster to SELECTORS and 1 more (compare)

  • May 28 09:05
    ddfreyne commented #1544
  • May 21 08:36

    ddfreyne on bundler

    (compare)

  • May 21 08:36

    ddfreyne on main

    Bump nokogiri from 1.11.3 to 1.… Merge pull request #256 from na… (compare)

  • May 21 08:36
    ddfreyne closed #256
  • May 17 21:41
    dependabot[bot] labeled #256
  • May 17 21:41
    dependabot[bot] opened #256
  • May 17 21:41

    dependabot[bot] on bundler

    Bump nokogiri from 1.11.3 to 1.… (compare)

  • May 17 02:43
    mh61503891 opened #1544
  • May 10 20:04
    iay commented #1541
  • May 10 19:11
    iay commented #1541
  • Apr 30 20:41

    ddfreyne on main

    Upgrade gems Auto-link GitLab MRs Upgrade gems and 4 more (compare)

  • Apr 30 20:38

    ddfreyne on bundler

    (compare)

  • Apr 30 20:38

    ddfreyne on main

    Bump rexml from 3.2.4 to 3.2.5 … Merge pull request #255 from na… (compare)

  • Apr 30 20:38
    ddfreyne closed #255
Denis Defreyne
@ddfreyne
@gpakosz The “File did not apear in time” issue happens when one filter is processing the output, and another thread wants access to the file. In that case, Nanoc waits for 1s at most for the file to appear, and if that time expires, Nanoc thinks something went wrong
This is not an ideal setup — Nanoc should be able to tell that the file is still processing, and thus needs to wait even more
(maybe with a timeout of 10s instead)
@gpakosz see def raw_path(snapshot: :last) in compilation_item_rep_view.rb
The timeout happens where Time.now - start > 1.0
Gregory Pakosz
@gpakosz
@ddfreyne I'm gonna try the PR but I don't believe adding timeouts solves the core issue of Item A wanting to load Item B output on disk until ItemB has been written to disk for real
@ddfreyne The Item A → Item B dependency is registered by the fact that Item A "calls" insert_image('/item-b.*'). But at as you can see in the screenshot above, that insert_image() helper calls #raw_path() and tries to load the file to get the image dimensions. And the file's not there (exacerbated by Vagrant using Virtualbox's shared folders, either with vboxfs or rsync)
Gregory Pakosz
@gpakosz
@ddfreyne And this also makes me think of "filters should be allowed to write metadata for later stages". It's different from the concept of fork you're introducing. And I don't think forks are a superset of "filters write/save information for later stages"
Denis Defreyne
@ddfreyne
The timeout increase of 1s -> 10s is not a proper solution, agreed
Harald
@a4z
is there a way to change the working directory, which always seems to be root, for a document ?
some things, like include directives for asciidoctor, or giving a docherder and footer, are natureally sensible to paths,
and when I have to specify the whole path, strings become long, and moving some page to an other folder will be real work ...
6 replies
Harald
@a4z

an other thing, I made my own asciidoctor filter , the render method in asciidoctor is marked as obsolete, and convert should be used, so I wanted to see if this works,
it does, and my filter looks now like this

module Nanoc::Filters
  class MyAsciidoctor < Nanoc::Filter
    identifier :myasciidoctor

    requires 'asciidoctor'

    def run(content, params = {})
      doc = ::Asciidoctor.load content, params
      #@item.attributes[:asciidoctor_attributes] = doc.attributes
      doc.convert params
    end
  end
end

please note the outcomented line, #@item.attributes[:asciidoctor_attributes] = doc.attributes ,
item is frozen so without super dirty tricks I can not change it,
but it would be nice to make the attributes of the document available/usable,
would this be some how possible ?

4 replies
Harald
@a4z
I am having a hard time to ignore html files from subfolders, I can ignore all others, but for html files, a folder/index.html is created, what do I oversee ? (its super late sunday evening so possible I am doing some thing wrong)
Harald
@a4z

still don't get why ignore for html documents does not work ....
I have a folder with some 001.adoc, 002.adoc, etc , a foo.txt, just for test, and a docinfo.html file.
my ignore Rules looks like that

ignore '/docs/BitBake/0*'
ignore '/docs/BitBake/docinf*'
ignore '/docs/BitBake/foo*'

the 0 and the foo ignore works, but I get a output/docs/BitBake/docinfo/index.html generated,
why ?

Harald
@a4z
seems there is some special handling for html files and ignore / routing does not exist for that file type, but I renamed the files, giving them a htm extension, instead of html and now the filter works :-)
works OK for me since this will give me the right syntax highlighting in my editor, and I do not need them in the output anyway, they are just config input for something else
Harald
@a4z
haha, everything is my error :-)
I just found a compile '/**/*.html' do block on the very top of the Rules file, must be generated by default since I think I did not write it, but my ignore rules have been after that .
moving them about that block, everything works as expected .... sorry for the noise , but this happens when working on such things late in the evening ;-)
Gregory Pakosz
@gpakosz
@ddfreyne 👋 waiting longer for files to appear works around the issues I faced with Vagrant
Thanks!
Gregory Pakosz
@gpakosz
anyone using Docker along with nanoc? if yes what's your ENTRYPOINT?
Denis Defreyne
@ddfreyne

@a4z Good to hear that you solved the issue!

Additionally: it could have been that the patterns don’t recurse into subdirectories (you’d need ** for that).

@gpakosz Oh right — Vagrant would have a slow-enough filesystem issue to trigger that problem with Nanoc
@gpakosz I use Nanoc as-is. I have tried it with Docker on a Mac, but the Docker for Mac filesystem is SO SLOW that compilation times got 10x–20x worse or so.
Gregory Pakosz
@gpakosz
@ddfreyne I want to provide a Docker file for some Windows users (despite I recommend WSL). What would use as an entry point?
It seems to me I need to come up with a wrapper script that calls bundle install. Not sure yet how to know bundle install should be called
Gregory Pakosz
@gpakosz
Not sure yet how to know when bundle install should be called
Denis Defreyne
@ddfreyne
@gpakosz I think the way I’ve done it in the past is calling bundle install when building the Docker image. In the Dockerfile, you have a bundle install --path=vendor/bundle
The entrypoint I would keep as-is… I generally try to not change it
Gregory Pakosz
@gpakosz
yeah that's what I'm wondering. Is bundle install part of provisioning the container or not
as far as I understand, if Gemfile changes I have to remember rebuilding the Docker image
Denis Defreyne
@ddfreyne
Indeed
Denis Defreyne
@ddfreyne
@gpakosz Fun coincidence — I ended up writing a Dockerfile that does bundle install just yesterday!
(For a side project that I’m involved in… working a sunday hehe)
You probably want something like this:
FROM ruby:2.6-slim-buster

ENV LC_ALL C.UTF-8

RUN apt update
RUN apt install -y build-essential

RUN gem update --system
RUN gem update
RUN gem install bundler

RUN mkdir /app
WORKDIR /app

ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install --without=test,development

ADD . /app
Gregory Pakosz
@gpakosz
did almost the same
instead of /app I used /nanoc which I mount to host's PWD
and now I'm heading towards separating /nanoc (mounted with -v "$PWD:/nanoc") and the place where gems are installed
because it may make no sense to install gem in a host path
and I don't want the gems to be part of the provisioning, so I'm using this entrypoint
#!/bin/sh

set -e

hr() {
  printf "%.0s—" $(seq 1 80)
  printf '\n'
}

bundle config set --local deployment true
bundle config set --local path .bundle
bundle config set --local without development

if ! bundle check 2>/dev/null; then
  hr
  printf "Installing gems...\n"
  bundle install
  printf 'done.\n'
  hr
fi

exec bundle exec nanoc "$@"
@ddfreyne btw will you make a release soon? with the timeout fix
Gregory Pakosz
@gpakosz
what are gem update --system and gem update for?
Gregory Pakosz
@gpakosz
Hmm I thought all the Ruby 2.7 warnings were solved
/home/vagrant/.bundle/ruby/2.7.0/gems/nanoc-cli-4.11.16/lib/nanoc/cli/commands/show-plugins.rb:17: warning: already initialized constant Nanoc::CLI::Commands::ShowPlugins::PLUGIN_CLASS_ORDER
/home/vagrant/.bundle/ruby/2.7.0/gems/nanoc-cli-4.11.16/lib/nanoc/cli/commands/show-plugins.rb:17: warning: previous definition of PLUGIN_CLASS_ORDER was here
/home/vagrant/.bundle/ruby/2.7.0/gems/nanoc-cli-4.11.16/lib/nanoc/cli/commands/show-plugins.rb:22: warning: already initialized constant Nanoc::CLI::Commands::ShowPlugins::PLUGIN_CLASSES
/home/vagrant/.bundle/ruby/2.7.0/gems/nanoc-cli-4.11.16/lib/nanoc/cli/commands/show-plugins.rb:22: warning: previous definition of PLUGIN_CLASSES was here
/home/vagrant/.bundle/ruby/2.7.0/gems/nanoc-cli-4.11.16/lib/nanoc/cli/commands/view.rb:19: warning: already initialized constant Nanoc::CLI::Commands::View::DEFAULT_HANDLER_NAME
/home/vagrant/.bundle/ruby/2.7.0/gems/nanoc-cli-4.11.16/lib/nanoc/cli/commands/view.rb:19: warning: previous definition of DEFAULT_HANDLER_NAME was here
3 replies
Gregory Pakosz
@gpakosz
damn docker fs is so slow
running nanoc live from within the container is not really bearable
Denis Defreyne
@ddfreyne
I think I told you that the Docker filesystem is unbearably slow :D
Sad but true
Gregory Pakosz
@gpakosz
even bundle exec nanoc view takes ages to start :(
Gregory Pakosz
@gpakosz
I don't remember is Nanoc's tmp dir configurable?
Gregory Pakosz
@gpakosz
Also did something changed with nanoc view?
previously, when using Vagrant, I could forward port 3000 from host to guest guest
and just launch $ bundle exec nanoc view