ChristopherFritz's Study Log

Sometimes when reading, I’ll encounter grammar I’m not familiar with, and I’ll skip looking it up since I get the gist of what’s being said. (Especially if I don’t have Internet access while reading.)

Looking up random grammar and seeing where it’s come up in what I’ve read is a bit exciting because the next time I see it I’ll recognize it and know its meaning. (Well, unless I forget that I ever saw it before.)


Elsewhere, rather than study, I’ve been slowly perfecting my Book Club Thread Builder.

It’s still far from ready, but I’ve been enjoying using it for the Shadows House book club. Each new week’s thread takes me about 10 seconds from start to finish to get posted. Then add a little more time to link to it from the home thread and the prior week’s thread.

Eventually, I’ll post it in the “how to run a book club” thread, but for now, here’s a peek (if I haven’t shown it before already here) for anyone who’s curious.

Main book club information:

Schedule information:

Home thread:
image
(This one still needs a lot of work!)

Weekly thread:

The last one is what saves me a decent amount of time each week. Gone are the days of doing a copy and paste of the last week’s post and manually updating values. (Well, I still do that for Mitsuboshi Colors.)

Current to-do list:

  1. Finish the home thread builder.
  2. Add a weekly reply builder, for a one-thread-per-volume offshoot clubs.
  3. Allow for multiple book clubs to be handled in one spreadsheet (so I can use it for multiple book clubs during development).
12 Likes

You do know that I built such a thing already (and use it weekly)?

The github repo contains all of the configurations for all book clubs I ran with it, so you can take a look there if you like. (I haven’t tried the newer versions of the scripts on the very old book club configurations, but they should still work™ :grin:) The README should give you a fairly good idea, but if you like I can talk you through the creation & weekly update processes.

I also mentioned this generator a couple of times here and there, but nobody seemed interested in using it :woman_shrugging: I don’t mind, I know how much time it saves me so that’s why I built it in the first place. I just thought I’d let you know. (Of course, if you want to build your own generator for the sake of building it, I can relate to that :upside_down_face:)

9 Likes

I’ve checked it out before, but back when I wasn’t doing much in the way of running book clubs, so I didn’t look at it much at the time. I should give it another look.

Was this previously written in Python, or was it always TypeScript?

It’s probably the common reasons:

  1. Most people probably don’t have npm/nmx installed. (Possibly no quick/easy way to install on Windows/Mac?)

  2. Many people are uncomfortable with command-line tools.

That’s always a part of it =D

4 Likes

I’m not a Python person (I don’t like languages that work off of indentation, with Haskell being the big exception for me), so initially it was JavaScript/node.js, and I initially implemented it in a way that it would not even require external modules (which saves you one step in the commandline), but when I realized that nobody really used it, and that it became larger and thus more painful to maintain in plain JavaScript, I switched to TypeScript (and some libraries like luxon for date handling).

If one-click isn’t quick and easy enough, then I don’t know what is though? :sweat_smile: Node.js
(I’m on a Mac in case you wonder)

Yeah, sure, I factored that in, but when I see how much people fiddle around with TamperMonkey and stuff like that, I’m still surprised that not even one single person tried it (to my knowledge) even though I have a step-by-step tutorial and even offered personal support and stuff. Maybe I’m just too old :woman_shrugging: and therefore much more used to “the metal” than these kids nowadays :stuck_out_tongue_winking_eye:

Also, tbh I have no idea how to design a UI for it because it reads a config file and produces multiple files. So for me the file system (plus text editor) is the natural interface. I even started a discussion in that thread about designing a UI (after that criticism came up) but nobody was even interested in thinking about it. :woman_shrugging: I would maybe even build it in that way and host it online if people had a good idea of how this might work well in a browser. But with zero interest, it’s less work for me, you know? :upside_down_face:
(I mean, the ultimate solution would of course be the script manipulating Discourse automatically, but I hear that this is not a favoured solution for the WK team.)

Sure, we all cherish our not-invented-here-syndrome :grin: :crazy_face:

7 Likes

I don’t even know why I’m reading your conversation… you two are so over my head, but I’m :star_struck:

:laughing:

4 Likes

For the intersection of people who:

  • read my study log
  • use Migaku’s browser extension
  • read (or plan to read) some of the same manga as I read
  • look up words via Migaku’s browser extension’s dictionary while reading manga

(Yes, all zero of you.)

I’ve put my manga-based frequency lists (formatted for use with Migaku’s browser extension) online here:

(Also linked in the resource section in my first post on this thread.)

These allow one to see the frequency of a looked-up word in various manga series.

When I look up a word while reading, this lets me know how likely I am to see the word again in the series.

If this word wasn’t already obvious to me without looking it up, I’d probably still skip adding it to Anki as it’s so rare in this series (one star out of five).

7 Likes

That’s brilliant. Even copying and pasting the new section from the old ones felt like it took longer.

3 Likes

We can become their fanclub/cheerleaders :handshake:

5 Likes

This is really cool! The padding is a smart way to take care of it all! (Also, does Migaku now support OCR? Or where do you read that the manga has selectable text? I’m asking because I technically do have a migaku account to support their development, but haven’t really used it all that much)

3 Likes

Migaku doesn’t support OCR yet, although it’s on their (very long) to-do list.

For manga with furigana, I actually don’t use text selection, as I can easily type into the dictionary.

For manga without furigana, I use Mokuro. For this, I need to remove the DRM from the manga I buy, then extract the page images from the EPUB (zip) file.

Mokuro generates an HTML page that acts as a reader for the manga images with selectable text. From there, hover over dialogue to get selectable text, press the ` key for Migaku to parse it, and optionally press Shift to do a lookup:

image

image

I believe someone’s also created a modification for Mokuro so you can parse the entire HTML in one go (rather than one text box at a time), but I haven’t looked into that yet.

3 Likes

That’s really cool, definitely looking into it ^^

2 Likes

Technical post today. Wordpress.


I like doing write-ups of grammar, vocabulary, and kanji as doing a write-up often helps with learning. It also gives me something to look back on.

The problem is a lack of any way to easily compose the kind fo posts I like to write, examples from manga.

Here’s an example posting:

Here’s what the post looks like underneath:

<p><a href="/ones-house-with-〜んち/">Grammar Explanation</a></p>
<div class="example">
[caption id="attachment_3069" align="alignright" width="300"]<a href="http://japanese.kurifuri.com/wp-content/uploads/三ツ星カラーズ-volume-4-page-38-panel-1.jpg"><img class="size-medium wp-image-3069 border" src="http://japanese.kurifuri.com/wp-content/uploads/三ツ星カラーズ-volume-4-page-38-panel-1-300x147.jpg" alt="" width="300" height="147"></a> 三ツ星カラーズ » Volume&nbsp;4 » Page&nbsp;38[/caption]
<p>&nbsp;</p>
<p class="summary">Sacchan and her friends decide to make a movie about the district they live in. They stop by Sacchan's mother's shop to film a scene.</p>
<dl class="dialogue">
<dt class="noruby">さっちゃん:</dt>
<dd>「<ruby>次<rp>(</rp><rt>つぎ</rt><rp>)</rp></ruby>はうち<strong>んち</strong>!<ruby>黄瀬<rp>(</rp><rt>きせ</rt><rp>)</rp></ruby>フルーツ。これがかあちゃん」</dd>
<dd>"Next is my place! Kise Fruits. This is my mom."</dd>
<dt>お<ruby>母<rp>(</rp><rt>かあ</rt><rp>)</rp></ruby>さん:</dt>
<dd>「<ruby>黄瀬<rp>(</rp><rt>きせ</rt><rp>)</rp></ruby>フルーツへようこそー」</dd>
<dd>"Welcome to Kise Fruits."</dd>
</dl>
</div>
<p>「うちのうち」 is contracted into 「うんち」.</p>

And here’s a page I wrote to help write the “underneath”:

Fill out the values, click the button, and then copy and paste the HTML into Wordpress.


This all works well until I want to modify the structure of these pages.

For example, the summary is designed to only be one paragraph. What if I want a multi-paragraph summary? I can change the structure going forward, but not for older posts.

Another example, if I want to style content that doesn’t have anything I can reliably hook a style to, there’s no easy way to update older content for this.

I’ve been wanting to make use of custom fields for some time now, but the latest Wordpress theme (the one I’m using) doesn’t support the methods I’m familiar with for using custom fields in a post. The reasons make sense (old methods were theme-dependent), so I begrudgingly looked into how to make it work “the new way”.

This led to learning about the Lazy Blocks plugin. And with that, after the longest time resisting Wordpress’s new block-based editor in favor of the classic HTML editor, I’m finally making the switch to their new editor.

After designing my own “block” with Lazy Blocks, I’m able to keep the structure separate from the content for these types of posts:

This also makes it easier when I want to embed one of these postings into a longer page:


Since each instance of the block needs its own unique ID and I don’t know if unique IDs get stored anywhere, I don’t plan to go back and convert all my old content to use the block. At least, not all at once. (That would take forever for no benefit.)

But as I find I want to embed older grammar samples into grammar explanation posts, I can convert them at that time.

7 Likes

Have you considered using Jekyll or something like that? With it you would keep your raw data, and you can generate your HTML off of it when needed. If you change your template, just regenerate everything, and you‘re good to go.

5 Likes

I’ve never heard of Jekyll before.

Looking it over, it sounds interesting. I’d definitely check it out if I were starting a new website.

Things I’d have to work with if I were to try it on my existing site:

  • Get over 200 existing pages up and running, with their existing URLs.
  • Work out a theme, something I’m bad at. (Right now I simply use a default Wordpress theme.)
  • Re-implement anything I’m using Wordpress plugins for that impact pages (FooBox Image Lightbox, Insert Pages).
  • Overall time investment.
2 Likes

Oh I was thinking as a first step you could just generate and copy over, just like your current process. That would save you nothing on the first run but it would help you already when you change your layout. And then you can take it from there step-by-step.

For the theme, you could just copy the Wordpress theme and enhance it with placeholders where you need them.

5 Likes

As it turns out, getting the pages from Wordpress to Jekyll isn’t straightforward due to the various changes I’ve made to how I put post content together over time. I’ve been able to script a bit of it, but I still need to manually touch up each page. Roughly 85 pages down, roughly 140 left to go. (Gives me an excuse to get in listening to old-time radio shows as I go.)

After I convert the rest of these pages, I’ll play around with the layout a bit. Although my site gets zero traffic other than search engines and myself, maybe I’ll use this as an excuse to learn how to make a site presentable on handheld devices (smartphone, tablet).

I’m definitely liking building pages based on content without template markup being manually put into every page.

---
layout: example
title: Might have similar tastes with 〜かもしれない
date: 2018-10-28 22:57:44
tags: 〜かもしれない
category: Grammar
series: ご注文はうさぎですか?
volume: 1
page: 92
image: gochiusa-volume-1-page-92-side-1-panel-3.jpg
border: false
explanation: Might with 〜かもしれない
summary: At the library, Cocoa thinks she realizes which book Chino is trying to find, but forgot the title of.  She suggests the two of them <strong>might</strong> have matching preferences in books.
dialogue:
 - speaker: ココア
   japanese:
   - line: <ruby><rb>私</rb><rp>(</rp><rt>わたし</rt><rp>)</rp></ruby><ruby><rb>本</rb><rp>(</rp><rt>ほん</rt><rp>)</rp></ruby>の<ruby><rb>趣味</rb><rp>(</rp><rt>しゅみ</rt><rp>)</rp></ruby><ruby><rb>合</rb><rp>(</rp><rt>あ</rt><rp>)</rp></ruby>うの<strong>かもしれない</strong>ねっ
---

Left: Wordpress | Right: Jekyll

I’m not yet certain how embedding the content of one post into another post will go, but I’m sure I can figure something out.

Between this and Splatoon 3, my daily manga reading will probably be minimal for the next week…

Thanks for mentioning Jekyll, @NicoleIsEnough! Did I mention yet that I’m really, really liking this separation of content from template markup?

5 Likes

There are probably Jekyll plugins for Furigana, such as this one – GitHub - guentoan/jekyll-furigana

I am not sure if templating engine (in Jekyll) can go down to individual posts.

2 Likes

I was really hoping to use this plugin, but it doesn’t work for me =(

Even though it installs, Ruby cannot load it:

chris@mercurius:~$ ls /var/lib/gems/3.0.0/gems/
addressable-2.8.1       ffi-1.15.5                   jekyll-seo-tag-2.8.0       naturally-2.2.1      rspec-expectations-3.11.1
bundler-2.3.22          forwardable-extended-2.6.0   jekyll-sitemap-1.4.0       pathutil-0.16.2      rspec-mocks-3.11.1
clipboard-1.3.6         http_parser.rb-0.8.0         jekyll-watch-2.2.1         public_suffix-5.0.0  rspec-support-3.11.1
colorator-1.1.0         i18n-1.12.0                  kramdown-2.4.0             rake-10.5.0          safe_yaml-1.0.5
concurrent-ruby-1.1.10  jekyll-4.2.2                 kramdown-parser-gfm-1.1.0  rake-13.0.6          sassc-2.4.0
data_uri-0.1.0          jekyll-feed-0.16.0           liquid-4.0.3               rb-fsevent-0.11.2    terminal-table-2.0.0
diff-lcs-1.5.0          jekyll-furigana-1.0.0        listen-3.7.1               rb-inotify-0.10.1    unicode-display_width-1.8.0
em-websocket-0.5.3      jekyll-image-size-1.2.1      mercenary-0.4.0            rouge-3.30.0         webrick-1.7.0
eventmachine-1.2.7      jekyll-paginate-1.1.0        mini_magick-4.11.0         rspec-3.11.0
fastimage-2.2.6         jekyll-sass-converter-2.2.0  natto-1.2.0                rspec-core-3.11.0
irb(main):001:0> require 'jekyll-furigana'
<internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- jekyll-furigana (LoadError)
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from (irb):1:in `<main>'
        from /usr/lib/ruby/gems/3.0.0/gems/irb-1.3.5/exe/irb:11:in `<top (required)>'
        from /usr/bin/irb:23:in `load'
        from /usr/bin/irb:23:in `<main>'

Looks like I might have to figure out how to write my own plugin!

4 Likes

I am not sure about writing and publishing Gems (also I am not sure about using Gems without publishing), but the plugin is simply – Create ./plugins/furigana.rb with the content.

module Jekyll
  module FuriganaFilter
    def furigana(base, top)
      "<ruby>#{base}<rp>(</rp><rt>#{top}</rt><rp>)</rp></ruby>"
    end
  end
end

Liquid::Template.register_filter(Jekyll::FuriganaFilter)

And use with {{ '私' | furigana: 'わたし' }}

2 Likes

It took me a bit of time, but I came to the same solution earlier today. If I hadn’t, then your post would have really helped, so thanks for that!

I went with the (kanji:kana) syntax that the Jekyll-Furigana plugin uses, although I did need to modify the regex a little as it was trying to convert some things that it shouldn’t. This is what I’ve settled on:

module Jekyll
  module Furigana
    def furigana(html)
      return html unless furi_enabled?

      html.gsub!(/\(([^:\(\)]*):([^\)]*)\)/, "<ruby><rb>\\1</rb><rp>(</rp><rt>\\2</rt><rp>)</rp></ruby>")
      html
    end

    private

    def furi_enabled?
      @context.registers[:page]['furigana'] == true
    end
  end
end

Liquid::Template.register_filter(Jekyll::Furigana)

I’ve been enjoying getting my convent converted from Wordpress to Jekyll. I’ve wanted for such a long time to have this kind of separation of content from markup. I’m down to about 20 more posts to convert over, then I’ll be ready to replace Wordpress!

5 Likes