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

[MNGSITE-507] Convert APT to Markdown #573

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kwin
Copy link
Member

@kwin kwin commented Oct 29, 2024

The converter from
apache/maven-doxia-converter@4061da5 was used with the following options:

java -jar doxia-converter-1.4-SNAPSHOT-shaded.jar -in ./content/apt -from apt -out ./content/markdown -to markdown -removeIn

@kwin
Copy link
Member Author

kwin commented Oct 29, 2024

After applying tons of fixes to Doxia and Converter this looks good to me now.

@michael-o
Copy link
Member

Did you diff the produced HTML? Especially <section> elements are missing and CSS isn't properly applied.

The converter from
apache/maven-doxia-converter@4061da5
was used with the following options:

java -jar doxia-converter-1.4-SNAPSHOT-shaded.jar -in ./content/apt
-from apt -out ./content/markdown -to markdown -removeIn
@kwin kwin force-pushed the feature/apt-to-markdown-v2 branch from 954d634 to d461d61 Compare October 29, 2024 17:35
@kwin
Copy link
Member Author

kwin commented Oct 29, 2024

I don't care about the HTML differences too much, I manually validated that the content looks reasonable now. I haven't found any obvious issue with CSS.

@michael-o
Copy link
Member

I don't care about the HTML differences too much, I manually validated that the content looks reasonable now. I haven't found any obvious issue with CSS.

One of the problems I have seen multiple times: https://github.com/apache/maven-fluido-skin/blob/master/src/main/resources/css/maven-base.css

@kwin
Copy link
Member Author

kwin commented Oct 29, 2024

@michael-o Can you be more specific? I fail to see the relation between this conversion and a general CSS resource of the fluido-skin. What exactly is incorrectly rendered?

Copy link
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

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

The first difference I see is that comments are fully retained. The generated HTML contains the license header. Waste, isn't it? The comments which aren't HTML style should be stripped.

Is this the bug: https://github.com/apache/maven-doxia/blob/e6190a9aa5121bfda9bb4efac3acd4cbbfee5880/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java#L291-L306?

@michael-o
Copy link
Member

Next diff: Code blocks from APT, not verbatim ones are lost, so is autohighlight. Example: developers/committer-settings.html

@michael-o
Copy link
Member

michael-o commented Nov 2, 2024

conventions/code.html misses anchors as well es in other files. Explicit anchors are lost.

@michael-o michael-o marked this pull request as draft November 2, 2024 22:50
@kwin
Copy link
Member Author

kwin commented Nov 4, 2024

Next diff: Code blocks from APT, not verbatim ones are lost, so is autohighlight. Example: developers/committer-settings.html

Well, https://maven.apache.org/developers/committer-settings.html has the following APT:

+-----+
<settings>
...
<servers>
<!-- To publish a snapshot of some part of Maven -->
<server>
<id>apache.snapshots.https</id>
<username> <!-- YOUR APACHE LDAP USERNAME --> </username>
<password> <!-- YOUR APACHE LDAP PASSWORD --> </password>
</server>
<!-- To stage a release of some part of Maven -->
<server>
<id>apache.releases.https</id>
<username> <!-- YOUR APACHE LDAP USERNAME --> </username>
<password> <!-- YOUR APACHE LDAP PASSWORD --> </password>
</server>
...
</servers>
</settings>
+-----+

According to https://maven.apache.org/doxia/references/apt-format.html#verbatim-text this is just verbatim text with a box around it.
This is converted to https://github.com/apache/maven-site/pull/573/files#diff-ad6899066ecffca374fb2b9eb533e56c42e397026a9a577f78c42ac3fae9902cR36.

I see that the HTML generated out of the converted MD is lacking the hightlighting and line number, but I think this is due to https://issues.apache.org/jira/browse/MSKINS-245 because the HTML looks good to me i.e. enclosed in {{

...
}}. In MD every verbatim text is emitted in code blocks!

What exactly do you consider wrong here @michael-o ?

@kwin
Copy link
Member Author

kwin commented Nov 4, 2024

The first difference I see is that comments are fully retained.

This is not new and not strictly related to the conversion but I tracked this now in https://issues.apache.org/jira/browse/DOXIA-758

@kwin
Copy link
Member Author

kwin commented Nov 5, 2024

conventions/code.html misses anchors as well es in other files. Explicit anchors are lost.

Tracked in https://issues.apache.org/jira/browse/DOXIA-759

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.

3 participants