Skip to content

Comments

Remove Darkfish and JsonIndex generators#1617

Open
st0012 wants to merge 5 commits intomasterfrom
remove-darkfish
Open

Remove Darkfish and JsonIndex generators#1617
st0012 wants to merge 5 commits intomasterfrom
remove-darkfish

Conversation

@st0012
Copy link
Member

@st0012 st0012 commented Feb 19, 2026

With Aliki, we don't need these 2 generators anymore. Removing them will allow us to do more cleanups/improvements in the future.

After this is merged, I'll see how we can re-architect Aliki's generator logic.

Darkfish has been deprecated since Aliki became the default theme.
This makes Aliki a standalone generator by inlining all inherited
methods from Darkfish, then removes Darkfish and JsonIndex entirely.

- Make RDoc::Generator::Aliki a standalone class (no longer inherits
  from Darkfish), with all template rendering infrastructure inlined
- Remove RDoc::Generator::Darkfish and RDoc::Generator::JsonIndex
- Remove darkfish and json_index template directories
- Remove darkfish and json_index test files
- Update RDoc::Servlet to use Aliki instead of Darkfish
- Rewrite servlet search endpoints to use Aliki's search index format
- Remove autoload entries and require for darkfish
- Update tests to reflect Aliki as the sole HTML generator
@matzbot
Copy link
Collaborator

matzbot commented Feb 19, 2026

🚀 Preview deployment available at: https://c67d39c7.rdoc-6cd.pages.dev (commit: fd18e20)

These methods were only used by the now-removed JsonIndex generator.
Each had a TODO comment noting they should be removed after dropping
Darkfish/JsonIndex. The Aliki search index uses search_snippet instead.

- Remove ClassModule#search_record
- Remove TopLevel#search_record
- Remove MethodAttr#search_record
- Remove corresponding tests
- README: Remove Darkfish theme instructions, simplify theme section
- CONTRIBUTING: Remove Darkfish from themes and project structure
- AGENTS: Remove Darkfish from structure tree and generators list
- LEGAL: Remove Darkfish, JsonIndex/SDoc, and Fonts sections
- .stylelintrc.json: Remove darkfish CSS from ignoreFiles
- Return 404 for table_of_contents.html in servlet since
  Aliki does not have a table_of_contents template
- Remove tautological font assertions from aliki_test that
  only existed to contrast with the now-removed Darkfish theme
@hsbt
Copy link
Member

hsbt commented Feb 19, 2026

I don't think there's any problem with removing it, but how about extracting it as rdoc-darkfish-theme or something?

Someone might want to use it in future versions of rdoc.

@st0012
Copy link
Member Author

st0012 commented Feb 19, 2026

@hsbt But extracting it means that we'll still need to test it and do some kind of maintenance for it (update Ruby, update dependencies...etc).
I'm probably biased as Aliki creator, but to me Darkfish doesn't provide enough value to warrant these effort. If some users want to use Darkfish due to extensibility etc, we should put the effort into making Aliki work for those cases instead.

@vinistock
Copy link
Collaborator

Considering that users can have Darkfish customizations that don't apply to Aliki (breaking change), do we need to add a deprecation notice prompting users to migrate first? Or do we already have that?

I'm all for removing and simplifying the codebase, just trying to be careful about breaking changes that might be impactful for projects.

The standalone Aliki generator was hardcoding @template_dir to
its own template directory, ignoring @options.template_dir. This
broke the --template flag, preventing third-party themes like
rorvswild-theme-rdoc from rendering with their own templates.

- Use @options.template_dir instead of hardcoded path
- Generalize write_style_sheet to copy css/, js/, fonts/, and
  images/ subdirectories so custom templates with fonts and extra
  assets work correctly
@st0012
Copy link
Member Author

st0012 commented Feb 19, 2026

@vinistock We don't have runtime deprecation and it's a bit late to add it now because the Prism-based parser change has been merged and the next release have to be a major release.

We did add this in the readme when changing the default them to Aliki:

Darkfish (deprecated) - The classic theme, will be removed in v8.0

And let me provide a bit more context about customizing themes in RDoc. There are 2 ways to do it:

  1. You create a new generator class, which will then handle things from data collection to asset locations to template rendering
  2. You create only assets and templates, and use --tempalte flag to run the current default generator with them

So this PR will definitely break anything that does 1 using Darkfish class as a superclass. BUT, there's no known theme that's based on the Darkfish generator this way, and received any update in the last 10 years, as shown by GH search result. I did this search 2 years ago when trying to renovate Darkfish. And I didn't find anything back then either.

As for themes using approach 2, because Aliki generator's implementation is still largely the same as Darkfish's, they should be unaffected by this change. I tested it with rorvswild-theme-rdoc, the only theme I know using this approach. And it's still working.

I also want to point out approach 2 is EXTREMELY fragile. Because the way templates are rendered using the generator object's binding, those templates have access to ALL methods, including private ones, and ALL ivars. So just renaming an ivar in Aliki generator could break themes doing it. As a result, I actually want to ban approach 2 going forward. But I can wait another major release for this.

@vinistock
Copy link
Collaborator

I agree that it's extremely fragile and it's a pattern that I would love to change. My main concern is for big projects with customizations, for example Rails' sdoc, which patches many internals of RDoc and includes a bunch of templates of their own. It might be worth giving them a heads up.

@st0012
Copy link
Member Author

st0012 commented Feb 19, 2026

SDoc uses its own generator, which doesn't inherit/reference Darkfish. So I think they're good here.

@p8 can you help me confirm if it's true that SDoc would not be affected by this change?

@st0012
Copy link
Member Author

st0012 commented Feb 20, 2026

FWIW, I ran SDoc's tests against this branch and it doesn't create additional failures (some tests are failing because RDoc's anchor/Prism parser changes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants