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

Fix: broken output in Documentation Code Snippets #4919

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

AdarshRawat1
Copy link
Member

@AdarshRawat1 AdarshRawat1 commented Sep 18, 2024

Recent Update to PR

I'm pushing a temporary fix for the code output renders. I'll be reaching out to the Doxygen team about the issue, and hopefully, it will be resolved in the next release.
The issue arises when we include one README file within another; in this case, the code blocks are not processed correctly.

What was done

I made a copy of broken code snippets

  • The original copy is kept to correctly render code in GitHub Markdown preview. ( This is hidden from doxygen using \internal command. )
  • The copy snippet is enclosed in \code{.c} & \endcode commands of Doxygen. Because these commands are capable of rendering the snippets correctly even when included from external Markdown.

Changes

Minor fixes in documentation output.

Screenshots of Changes
Screenshots of Broken codes for multiple Markdowns
  • Broken Code snippets for merged Markdown files
    image

  • Fixed
    image

@AdarshRawat1 AdarshRawat1 changed the title Fix broken output text in Documentation Code Snippets Fix broken output in Documentation Code Snippets Sep 18, 2024
@AdarshRawat1 AdarshRawat1 changed the title Fix broken output in Documentation Code Snippets Fix: broken output in Documentation Code Snippets Sep 18, 2024
@fruffy fruffy added the documentation Topics related to compiler documentation. label Sep 18, 2024
Copy link
Contributor

github-actions bot commented Sep 18, 2024

githubloading A preview of this PR is available at: Preview Link
📂 View the source code here: View Source Code
🔧 Commit used for deployment: dd0dd422f823163adb5ad4a2f76eee4745375586

Note: Changes may take a few seconds to appear on GitHub Pages. Please refresh the page if you do not see the updates immediately.

@fruffy
Copy link
Collaborator

fruffy commented Sep 24, 2024

Is this ready for review?

@AdarshRawat1
Copy link
Member Author

Is this ready for review?

I was a bit occupied with university formalities, I'll complete this ASAP.

@AdarshRawat1 AdarshRawat1 marked this pull request as ready for review October 28, 2024 16:16
@AdarshRawat1 AdarshRawat1 marked this pull request as draft October 28, 2024 17:16
@AdarshRawat1 AdarshRawat1 marked this pull request as ready for review November 6, 2024 15:06
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
This syntax is processed correctly by Doxygen

Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
@AdarshRawat1
Copy link
Member Author

@fruffy Ready for merge !

@fruffy fruffy requested a review from jafingerhut November 10, 2024 18:03
@@ -68,7 +68,7 @@ To load the 'spec' file in dpdk follow the instructions in the
- Currently, programs written for DPDK target should limit the functionality in Ingress blocks, in case non empty Egress blocks are present it will be ignored by default unless Hidden temporary option `--enableEgress` used. When egress block support gets added to the DPDK target, and compiler can generate separate spec file for non empty ingress and egress blocks then option `--enableEgress` will be removed.
- DPDK architecture assumes the following signatures for programmable block of PSA. P4C-DPDK converts the input program to this form.

```P4
``` P4
Copy link
Contributor

Choose a reason for hiding this comment

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

So I spot-checked the preview page here to see what effect this change had.

WIth this change, there is now a separate line of text that says "P4" before the block of code.

Is that intentional? Do you consider that an improvement?

Copy link
Member Author

@AdarshRawat1 AdarshRawat1 Nov 12, 2024

Choose a reason for hiding this comment

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

Hi @jafingerhut,

Is that intentional?

Yes

Do you consider that an improvement?

This is a temporary fix. The current version of Doxygen(1.12.0) does not support numeric code fences. So, I added a "P4" label with a gap before code blocks because, without it, only the "4" shows up in Doxygen HTML output. I thought "P4" is clearer than just "4."

I also reported this to Doxygen, and they’ve pushed a fix, which should be live in the next release. doxygen/doxygen#11210

Once the new release is available, I’ll revert this change.

@@ -114,7 +114,8 @@ P4Testgen supports the use of custom externs to restrict the breadth of possible

#### Restricted Tests
`testgen_assume(expr)` will add `expr` as a necessary path constraints to all subsequent execution. For example, for the following snippet
```p4
``` P4

Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as my earlier one for this change. I am not planning to check all of them, but I would guess that the ones that inserted a space after ``` before P4 are probably similar to this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, this is similar to all other P4 code block.

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

Successfully merging this pull request may close these issues.

3 participants