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

Docs : Add Home page for documentation #4764

Merged
merged 36 commits into from
Jul 9, 2024
Merged

Conversation

AdarshRawat1
Copy link
Member

@AdarshRawat1 AdarshRawat1 commented Jun 28, 2024

Changes

View live demo

Home page

  • Added Initial Home page Structure and content of the documentation website with Cards and Easter egg. [Click on the P4C logo area to activate]
  • Created & uploaded P4 compiler Architecture Assets via Draw.io. [block in diagram contains links to respective backend documentation. ]

Demo of Easter egg and diagram -

Home.page.feat.mp4

New Sections included in documentation

  • Included root README file into documentation. Having the following sections - [dependency, getting started section, P4 Compiler Onboarding, Contact etc]
  • Added Contribution guides to documentation

Update in Website layout

  • UI: Switch to sidebar only theme

image

Update in color scheme

  • UI: P4 logo color scheme

Current Colors

Color Role Light Mode Dark Mode
Primary Color #1779c4 #1779c4 #1982d2 #1982d2
Primary Dark Color #335c80 #335c80 #5ca8e2 #5ca8e2
Primary Light Color #70b1e9 #70b1e9 #4779ac #4779ac

Updated Colors

Color Role Light Mode Dark Mode
Primary Color #8cc63f #8cc63f #8cc63f #8cc63f
Primary Dark Color #4b6c21 #4b6c21 #4b6c21 #4b6c21
Primary Light Color #c4f0a1 #c4f0a1 #c4f0a1 #c4f0a1

@fruffy fruffy added the documentation Topics related to compiler documentation. label Jun 28, 2024
@jafingerhut
Copy link
Contributor

The first diagram looks impressive. Should there be links in the figure to different parts of the docs?

The 3 big sub-figures at the bottom seem to take me back to the same page, rather than going to relevant sections of the documentation. Is this part of the work-in-progress for this PR?

Also many of the doxygen headings are back to README in that generated page. Perhaps this PR is based on an older version of the p4c repo that doesn't have some recent commits merged in?

@AdarshRawat1
Copy link
Member Author

The first diagram looks impressive.

Thank you

Should there be links in the figure to different parts of the docs?

No, it is a static diagram

The 3 big sub-figures at the bottom seem to take me back to the same page, rather than going to relevant sections of the documentation. Is this part of the work-in-progress for this PR?

This is still a work in progress because, we haven't added those sections to our documentation yet. They will be added in this PR Check this commit.

Also many of the doxygen headings are back to README in that generated page. Perhaps this PR is based on an older version of the p4c repo that doesn't have some recent commits merged in?

Yes, you guessed it right !!
This is a demo only for the home page, rest of the configuration are not updated as per latest commits. I made this just to give an idea of how the final result will look after merging.

I'll update the PR soon .

@AdarshRawat1
Copy link
Member Author

Should there be links in the figure to different parts of the docs?

This sounds interesting, I'll give it a try.

@jafingerhut
Copy link
Contributor

There seem to be redundant copies of the same .svg figure in the docs/assets and docs/doxygen directories. Can that be removed?

@AdarshRawat1 AdarshRawat1 marked this pull request as ready for review July 3, 2024 13:03
docs/doxygen/Doxymain.md Outdated Show resolved Hide resolved
<div class="diagram-container">
<!-- draw.io diagram -->
<div class="mxgraph" style="" data-mxgraph="{&quot;highlight&quot;:&quot;#0000ff&quot;,&quot;lightbox&quot;:false,&quot;nav&quot;:true,&quot;edit&quot;:&quot;_blank&quot;,&quot;url&quot;:&quot;https://drive.google.com/uc?id=16X8Z_4-J8mHQPxuxm9HjWppPMTTXZdZ6&amp;export=download&quot;}"></div>
<script type="text/javascript" src="https://viewer.diagrams.net/embed2.js?&fetch=https%3A%2F%2Fdrive.google.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally we should not rely on google drive here. Can we upload this to Github somehow?

Copy link
Member Author

@AdarshRawat1 AdarshRawat1 Jul 5, 2024

Choose a reason for hiding this comment

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

I tried but, couldn't find a way to embed it via GitHub without compromising on functionality. Draw.io supports sharing only from Google Drive.
I'll see if I can find a workaround.

Copy link
Contributor

Choose a reason for hiding this comment

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

You should be able to save or export a .svg file from draw.io and save that anywhere you like, e.g. in this Github repo, yes?

Copy link
Member Author

Choose a reason for hiding this comment

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

You should be able to save or export a .svg file from draw.io and save that anywhere you like, e.g. in this Github repo, yes?

Indeed, I have included the diagram SVG and Draw.io file in this Pull Request.

Context - We want the SVG to be embedded with all functionality[links and dynamic toggle] while making sure that it is compatible with Doxygen output.
Draw.io is supporting embedding option only with Google Drive.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is the only thing blocking us here right now. The problem is we do not have control over when draw.io goes down or things change there.

Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if you use an .svg file checked into Github as part of the page, instead of using draw.io? Does something go wrong?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only thing blocking us here right now. The problem is we do not have control over when draw.io goes down or things change there.

I'm looking into this and I think it will be possible after exporting the diagram as HTML and then keeping it in repo.(Still trying to implement the easter egg rest of the part is working)

I'll convert this PR to draft for the time!!

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry that I didn't follow the design from the beginning so maybe this was already discussed. But I wonder whether https://github.com/mermaid-js/mermaid is an open-source alternative worth considering here?

Thanks for the suggestion, it seems like a good alternative. However, Draw.io was already finalized for diagrams.

  • Mermaid also probably doesn't support animation.

This is the main concern here, as current GitHub Hosted SVG in this PR can be easily embedded. But they don't support animation toggle.

Copy link
Member Author

Choose a reason for hiding this comment

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

What happens if you use an .svg file checked into Github as part of the page, instead of using draw.io? Does something go wrong?

The Easter egg toggle won't work!! Rest, there won't be any other change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally, I am fine giving up the Easter egg toggle if the docs page can rely only on files provided from one server, rather than requiring draw.io to be up and accessible as well.

docs/doxygen/Doxymain.md Outdated Show resolved Hide resolved
docs/doxygen/Doxymain.md Outdated Show resolved Hide resolved
docs/doxygen/Doxymain.md Outdated Show resolved Hide resolved
docs/doxygen/Doxymain.md Outdated Show resolved Hide resolved
docs/doxygen/Doxymain.md Outdated Show resolved Hide resolved
<div class="diagram-container">
<!-- draw.io diagram -->
<div class="mxgraph" style="" data-mxgraph="{&quot;highlight&quot;:&quot;#0000ff&quot;,&quot;lightbox&quot;:false,&quot;nav&quot;:true,&quot;edit&quot;:&quot;_blank&quot;,&quot;url&quot;:&quot;https://drive.google.com/uc?id=16X8Z_4-J8mHQPxuxm9HjWppPMTTXZdZ6&amp;export=download&quot;}"></div>
<script type="text/javascript" src="https://viewer.diagrams.net/embed2.js?&fetch=https%3A%2F%2Fdrive.google.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is the only thing blocking us here right now. The problem is we do not have control over when draw.io goes down or things change there.

@AdarshRawat1 AdarshRawat1 marked this pull request as draft July 9, 2024 03:19
@AdarshRawat1 AdarshRawat1 marked this pull request as ready for review July 9, 2024 08:03
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
- Moved diagram to Assets [Kept for reference only]

Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
AdarshRawat1 and others added 16 commits July 9, 2024 13:35
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Co-authored-by: Fabian Ruffy <5960321+fruffy@users.noreply.github.com>
Signed-off-by: Adarsh Rawat <adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>

Co-authored-by: Fabian Ruffy <5960321+fruffy@users.noreply.github.com>
Signed-off-by: Adarsh Rawat <adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Open links in new tab

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

AdarshRawat1 commented Jul 9, 2024

Fix : Switched to HTML file stored in this PR [GitHub repo] for embedding Diagram SVG. Now we are not relying on Draw.io or Google Drive.

p.s. I have updated the Demo link also, do let me know if there is any modification you would like on the diagram.

Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Copy link
Collaborator

@fruffy fruffy left a comment

Choose a reason for hiding this comment

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

Fix : Switched to HTML file stored in this PR [GitHub repo] for embedding Diagram SVG. Now we are not relying on Draw.io or Google Drive.

p.s. I have updated the Demo link also, do let me know if there is any modification you would like on the diagram.

This is great, thanks! We can figure out the other issues in subsequent PRs.

@fruffy fruffy added this pull request to the merge queue Jul 9, 2024
Copy link
Contributor

@jafingerhut jafingerhut left a comment

Choose a reason for hiding this comment

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

LGTM

Merged via the queue into p4lang:main with commit bfe41eb Jul 9, 2024
17 checks passed
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.

4 participants