Honyaku Architecture.
.
├── articles
│ ├── index.yaml
│ └── updates
│ ├── index.yaml
│ └── 0.1.0
│ ├── index.md
│ ├── index.yaml
│ └── ...
├── manga
│ ├── index.yaml
│ └── azumangadaioh
│ ├── index.yaml
│ └── 001
│ ├── index.yaml
│ └── 001
│ ├── index.yaml
│ ├── 001
│ │ ├── index.yaml
│ │ └── comic.tiff
│ └── ...
└── ...
This doesn’t really have much of an impact on what the reader sees, but it does make it easier to make content. So I’ll be able to share things more easily, and I’ll be able to start new series much faster.
In 0.1.0, the only officially supported media types were manga pages, and partial support for articles (markdown content).
I’ve re-used the manga UI to support different kinds of media:
Here’s some examples of that:
Link Navigator | Video |
---|---|
As mentioned, the 0.1.0 release wasn’t fully-featured with respects to markdown.
We’re now using a custom markdown HTML writer, and that allows us to do some additional operations to improve the content generated based on markdown text.
The text in markdown content can now be analyzed by JapaneseAnalyzer
.
This is the feature that allows the rest of the site to display things like word definitions, translations, and furigana.
How it works is by wrapping text in double-curly-brackets, ala {{日本語}}
.
So when I type that outside of a codeblock, it looks like this: .
Additionally, you can click the text to swap between the Japanese and the English translation. This was done using CSS, so it doesn’t require JavaScript.
(Go ahead and try clicking the Japanese text above!)
When code blocks are generated now, they’re first parsed and styled statically.
This allows us to, without the addition of JavaScript, style the code blocks.
Here’s an example of this:
// Create a new site generator instance for building honyaku.
// Note: Some of these types are constructed commonly in the parent function.
// All commands use the `dictionary` and CLI `flags`, for instance.
// You only need to know roughly what these are, the names should suffice.
let mut generator = Generator::new(GeneratorConfig {
// Categories for the Atom Feed on this page (inherited by the children).
categories: vec![
AtomCategory::from("Japanese"),
AtomCategory::from("Translation"),
AtomCategory::from("English"),
],
dictionary, // The dictionary, constructed in the parent.
flags: cmd.flags(), // From the CLI, constructed in the parent.
})?;
The initial implementation of Honyaku was single-threaded. As you can imagine, it ended up being quite slow when new content needed published.
One of the first things I worked on after 0.1.0 released was parallelizing the code so that we could optimize publishing the site.
It now takes a little over ~1 second to generate the site from cached content. And if new content needs published it takes only a minute or two as opposed to ~30 minutes (or more depending on how many images we have to publish).
This will allow me to publish patches and content faster, and it means we aren’t heading for a cliff as new content is added (originally it was getting slower with each new page added to the site).
There are a few things I’d eventually like to improve about this site. However, I’ve spent over a year on this project. I think I need to step away and work on other projects for the time being. :)
I plan on continuing regular content updates to this site, and the occasional patch release to fix small bugs when I notice them. However, I think the road to 0.3.0 is actually very long - I don’t plan on major feature updates for quite some time.