Replies: 1 comment 2 replies
-
StylesI like semantic style naming. I like to separate semantics from presentation. This means that I'd prefer a semantic meaning in the documentation, because it's easier both to be consistent (if the names are good), and to decide about presentation/design separately and ultimately change it everywhere if needed/wanted. I don't know if there is an "intermediate layer" of names possible here. I'd like the document source to use styles that describe the usage, not the design. So if we could find a way to have a translation from, say, "example" to some presentation style name like "lightgrey" with a single editing of a "mapping" somewhere, that would be my preference. You say "in hindsight, it would have been better...", do you mean that it is better to give the author of the document source to design the presentation? Because I think it depends on what we are trying to do. Semantic style names in documents would emphasise that design/presentation is done elsewhere, and probably also a common such design/presentation. Having presentation guiding style names emphasise the authors design/presentation ambitions. RakeI have no deep knowledge of Ruby, eventhough I have coded some in it. The use of And as you say, we need Ruby anyway. If there is a scenario where you don't need asciidoctor but still want to do some scripted work, say "linting" the document source, but not generating, that might be a thing to consider, but I think it is unlikely that we find an important such case. And if so, we could just say "install Ruby..." So, I'd be interested in a |
Beta Was this translation helpful? Give feedback.
-
@thoni56,
I wanted to share with you some significant updates to the project I had in mind.
Styles Renaming
Currently, we have three different styles (roles) for ALAN code blocks:
lib
(dark theme).tutorial
(light theme).The whole idea was to allow some documents to easily distinguish from generic code examples, library excerpts and snippets of the tutorial's source code.
With hindsight, it would have been a much better choice to use
dark
andlight
instead, separating any functional meaning from the actual style, and sticking instead to the theme being dark, light or neutral. Probably what I originally had in mind was to allow end users to customize/override the styles to their liking, so that tutorial code would not necessarily have to be light, etc.But I think that having the default theme as a neutral greyish, and providing the
dark
andlight
roles are a better approach, for they allow more freedom of use without sacrificing accuracy of representation (whilst still allowing customizations, e.g. by using alternative themes that are dark, light or neutral).So, I was thinking of updating these roles in all the source documents, here and across other repos, and update the Sass/CSS stylesheets accordingly, as well as the DocBook template.
Because it's a delicate operation involving synchronization across multiple projects I might need to proceed with caution, especially for the ALAN Manual, since these changes in role names might lead to potential conflicts between the
master
and alpha man branch.Maybe the right time to do this would be when the next Beta is out, and the Alpha branch is merged into
master
and we'll have a few days where the two branches are synched.These changes are also in view of the upcoming move of all shared assets into a common repository (to be submoduled — See #81, #83) or a dedicated Ruby Gem (more on that below), in either case these solutions are intended to avoid redundancy in maintenance across projects.
Adopting Rake for Building
The more I look into Ruby, the more I'm convinced that we should rely on Ruby for our toolchain. Rake is Ruby's alternative to Make — it's Make without the quirks, problems, hacks and troublesome problems of two different versions being in use.
Rake is not only powerful and simple to use, but it's ideal for our use cases since we need Ruby for Asciidoctor anyway.
Also, relying on Bash scripts to interface with Asciidoctor via the command line doesn't give us the full power of invoking Asciidoctor via Ruby scripts. E.g., if we want to integrate our new custom ALAN syntax for Rouge, the simpler way is to invoke Asciidoctor via its Ruby API.
Rake is more powerful than Make, and its "rakefiles" are just Ruby code on steroids, allowing invoking system libraries, shell commands, etc. In terms of cross platform compatibility, it's definitely a better choice, since Ruby libraries are OS aware — probably the FoPub toolchain would work on all OSs out of the box with Rake.
Furthermore, I was thinking of creating a small Ruby Gem for ALAN projects, which would contain shared assets like the CSS stylesheets, DocBook styles and templates, the syntax highlighters, etc. Being a Gem, we wouldn't need to include it as a Git submodule in every repository, since gems are installed globally, and are easy to update too.
This Gem could also contain some dedicated Rake modules for Alan and Asciidoc specific tasks, like checking that the correct ALAN SDK is present in the repository, based on a settings file (in the repository) and branch-based rules. Various ALAN-related build commands could be simplified via this Gem's modules, especially the complex stuff from the StdLib repository which extracts code examples from real sources (with tag comments that need to stripped off in the final package) and dynamically generated transcripts. All these tasks could be handled by custom commands.
A rakefile would then be created for each repository, in the root folder, allowing to use rake from the root (or even in subfolders) to execute various tasks (tests, builds, publishing on GHPages, etc.) via single commands, and let Rake handle downloading and unpacking the required Alan SDKs, etc.
What's your view on this?
Beta Was this translation helpful? Give feedback.
All reactions