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
I use kramdown with the gfm format (for code blocks), and then use Nanoc’s colorize_syntax filter to do the syntax highlighting
That reminds me that I want to open up the API for the colorize_syntax helper and support adding custom colorizers… it’s pretty straightforward but not officially supported:
class DenisColorizer < Nanoc::Filters::ColorizeSyntax::Colorizers::Abstract
  identifier :denis

  def process(code, language, params = {})
    # … return HTML containing highlighted `code` …
  end
end
  filter :colorize_syntax, default_colorizer: :denis
Christian Tietze
@DivineDominion
It seems Kramdown comes with Rouge by default. Maybe we don't need that anymore 🤔
I'm trying out removing the colorize_syntax filter
Christian Tietze
@DivineDominion
Need to find a replacement for Redcarpet::Markdown.new(Redcarpet::Render::StripDown, :space_after_headers => true) to make Markdown and HTML-less summaries for HTML descriptions and OpenGraph, rest looks good
and then extend the GFM Input to add wiki link finding
@ddfreyne Maybe that's relevant for nanoc upstream, too, since I'm using a custom strip_html replacement to avoid truncating in the middle of a word:
    # Custom variant of the built-in
    #     excerptize(strip_html(@item.compiled_content(snapshot: :pre)), length: threshold)
    # because the default also truncated in the middle of a paragraph.
    def plain_summary(item, threshold = 300)
      sanitizer = Rails::Html::FullSanitizer.new
      markdown = Redcarpet::Markdown.new(Redcarpet::Render::StripDown, :space_after_headers => true)

      content = sanitizer.sanitize(item.raw_content)
      content = markdown.render(content)
      content = content.gsub(/\((https?:\/\/|\/).*?\)/, '').gsub(/ ([ \.,;])/, '\1')

      "".tap do |summary|
        content[0..(threshold+50)].split.each do |word|
          summary << word + " "
          if summary.length > threshold
            summary << "..."
            break
          end
        end
      end
    end
Could maybe work with https://kramdown.gettalong.org/converter/remove_html_tags.html on the compiled content instead and then drop the Rails HTML helper
Christian Tietze
@DivineDominion
Stripping HTML removes links, too, but I think it's nicer for readers to show the plain text URL instead, that's why I went that route; but the point I want to make is rather the threshold algorithm to break on words, i.e. the bottom part
Christian Tietze
@DivineDominion
[[wiki link]] works! The pipe in the middle of [[pagename | Anchor Text]] is interpreted as a table cell separator, but apart from that, looks good :)
So this sorta works. I had to patch the table pipe recognition to ignore wiki links, and this is pretty slow this way
Christian Tietze
@DivineDominion
Ian Young
@iay
I've got some helper functions I've written for one of my sites and I'd like to write some unit tests for them. Is the nanoc-spec gem still a "don't use this" or is there otherwise something to help me build an item collection for tests?
Ian Young
@iay
(I've gone ahead and got that working with nanoc-spec but I'm still interested in the question of whether there's something better in there.)
Christian Tietze
@DivineDominion
Would be interested in that, too :)
Denis Defreyne
@ddfreyne
Hmm, good question about nanoc-spec. It hasn’t really changed much lately, so I think you can use it — though I can’t guarantee that there won’t be backwards-incompatible changes in the future
Ian Young
@iay
I'm fine with that proviso. The tradeoff is that testing code that moves around the content tree is tricky without some help. I have a couple of sites where I have some degree of interchangeability between /a.md and /a/index.md and there are a surprising number of edge cases for a concept like "parent" in that situation.
So nanoc-spec helped a lot.
Richard Downing
@theoldfellow
Just thought I'd say 'hi'. I last used Nanoc in 2015. And now I find I want to use it again. Great to know you are still going strong. And even more amazed to find that my sites still compile!
Denis Defreyne
@ddfreyne
Welcome back ;)
Christian Tietze
@DivineDominion
Anyone working on a JSON feed helper already by any chance? https://jsonfeed.org/
What brought this to my attention is the capability to display author avatars, which is cool for publications with multiple authors. The overall feed structure mimicks the feature of a Twitter timeline
b3nj
@b3nj
Hello guys.
i'm migrating an old website built on an older version of nanoc, using content_for method... which doesn't seem to exist anymore. can maybe anyone point me out what's the current preferred way ?
b3nj
@b3nj
seems it still exists, sorry :D
Denis Defreyne
@ddfreyne
@b3nj Glad to hear you found it!
@DivineDominion I’ve looked at JSON Feed, but haven’t implemented anything for it… could be good to add #json_feed to the Blogging helper I suppose!
Not quite Nanoc-related, but I’m rather happy with the horizontal multi-column layout for article I’ve been experimenting with: https://twitter.com/ddfreyne/status/1396578696962744329
Christian Tietze
@DivineDominion
I have an ultrawide at home, never tried horizontal scrolling and columnar layouts, though. Interesting!
Denis Defreyne
@ddfreyne
@DivineDominion I think it works especially well for the larger Lenses article (https://experiments.denisdefreyne.com/horizontal-layout/index-lenses.html). Still, it required more custom CSS (and even a bit of JavaScript) to get it to work super well.
Denis Defreyne
@ddfreyne
I’m looking for new career opportunities — anyone here have some good leads? :)
Also see --> https://twitter.com/ddfreyne/status/1399404990783950849
Christian Tietze
@DivineDominion
Denis Defreyne
@ddfreyne

Interesting! Though this is off-putting:

Ruby and JavaScript experience are a must; all Discourse applicants have a 40-80 hour paid trial project (over 2-10 weeks) prior to joining the team. The trial project usually involves adding a feature to Discourse or a Discourse plugin.

:grimacing:

Christian Tietze
@DivineDominion
I think that sounds cool. Ensures team compatibility and quality, and it's paid, so the risk is low for applicants
Denis Defreyne
@ddfreyne
It becomes problematic for people who have a full-time job, and especially for people who have responsibilities outside of work (e.g. parents, especially mothers)
Christian Tietze
@DivineDominion
40-80 hours would be 1-2 regular work weeks, right? And they say you can space it out over 10 weeks, so 4-8 hours per week doesn't sound too hard to make
if you have a 50h/wk job already, well that's tough
otherwise it'd boil down to 1 extra work day for 10 weeks at kost, e.g. Saturday. I dunno what more you could offer, excaept more time than 10 weeks, and I bet if you're a single father with a bunch of kids homeschooling, these nice folks might be trying to help
In my book this is as good as it could ever get -- if you want to get to know applicants at all, that is. Other companies might make do without onboarding like that, and it's fine to pick these instead. I don't see how Discourse's approach is problematic by design, though
Denis Defreyne
@ddfreyne
I think it becomes problematic when interviewing for multiple companies. I was in touch with ~15 companies for the job search this time around. Having a full-time job and doing tech challenges and 40–80 hours of extra paid work would add too much of a time burden
It’s possibly tricky from a legal/finance point of view in Germany as well, as you’d have to sign up to be a freelancer first (I know I had to)
In good news though, looks like I’ll have a new job soon — if all goes well!
Denis Defreyne
@ddfreyne
image.png
In other news, I looked through the Dart Sass API and found this.
This is good news, because it means that it should now be pretty simple to build a :dart_sass filter that does proper dependency tracking!
Christian Tietze
@DivineDominion
hmm so the deprecated Ruby Sass stuff might be replaced with that?
Denis Defreyne
@ddfreyne
I don’t think I’d replace it, but provide :dart_sass as an alternative to :sass. I don’t think it’s replaceable while keeping backwards compatibility.
Harald
@a4z
Awesome, was just stepping by to ask what the current state of the sass filter is
I am going now full pro in my web development and use that :-)
(just kidding, still have no clue what I do but I continue to use nanoc, and now I even build a new site)
but I guess, fastest would be to quickly add a own filter that assumes some dart/sass is in path and calls that ?