Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a custom postprocessor for FilterDocs #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wilzbach
Copy link
Member

As we are rewriting the assert/writeln pipeline and avoid making a full copy of the entire directory, but do the rewrite before calling Ddoc, we needed to do the same for Ddox.

For now, dlang/dlang.org#2069 does this, but still uses a lot of duplicated code from ddox.main.

The idea of this config object is to reduce the amount of duplication between dpl-docs and ddox.

@s-ludwig
Copy link
Member

I feel like this should be part of GeneratorSettings instead. The filter command is meant to just remove unwanted parts of the documentation, not to alter it arbitrarily. It would of course also be nice to have a range based approach one day, but for now string based sounds fine.

@wilzbach
Copy link
Member Author

I feel like this should be part of GeneratorSettings instead.

Ok. While I was at it, I added the ability to accept GeneratorSettings to the other commands too. Might come in handy to other people.

The filter command is meant to just remove unwanted parts of the documentation, not to alter it arbitrarily.

Yeah, I felt like a hack, but the filter already rewrites the comment and searching for the generated output of this felt hacky too :/

last_decl["comment"] ~= format("Example:\n%s$(DDOX_UNITTEST_HEADER %s)\n---\n%s\n---\n$(DDOX_UNITTEST_FOOTER %s)\n", comment.strip, name, source, name);

It would of course also be nice to have a range based approach one day, but for now string based sounds fine.

I had the same thoughts :/

@wilzbach
Copy link
Member Author

@s-ludwig so anything missing from this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants