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

Introduce a feature to skip a single page TOC validation #62

Merged
merged 3 commits into from
May 28, 2019

Conversation

mino181295
Copy link
Contributor

In this pull request I introduced a meta tag

<meta name="docet-hidden-page" >

To skip the TOC unlinked file validation.
Writing the head tag with inside this meta you can still pass the validation of the documentation page.

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome.
But we are missing one step: while serving the HTML to the client we have to remove the META tag.

We could also add a minimal test case about the serve side part (a unit test about the removal of the tag)

@mino181295
Copy link
Contributor Author

mino181295 commented May 28, 2019

It's built in the DocetManager#servePageIdForLanguageForPackage that when you serve a html/pdf page you never include what is inside the head of the document and some tags are cleaned (like <script> tags)

case TYPE_HTML:
     html.append(htmlDoc.body().getElementsByTag("div").first().html());
     html.append(generateFooter(lang, packageName, pageId, faq));
     res = DocetUtils.cleanPageText(html.toString());

For the test: to follow all the DocetManager#serveRequest it's a long run to mock/follow all the page request and discorvery.

@eolivelli eolivelli merged commit bf36134 into diennea:master May 28, 2019
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.

2 participants