Drasil icon indicating copy to clipboard operation
Drasil copied to clipboard

Website: add links to the source code for each generated example #3668

Open BilalM04 opened this issue 9 months ago • 2 comments

Added links to the source code for each generated example on the website. Also updated the stable website to reflect those changes.

NOTE: I followed the existing code to add the new references. However, a problem, which @balacij pointed out, is that each chunk is being created twice. This may require a redesign of the code.

image

Closes #3668

BilalM04 avatar May 08 '24 19:05 BilalM04

Can we change the link name from "Source Code" to "Drasil Source Code"? It isn't that big a deal, but when I first read Source Code, it made me think of the generated code. If we add in the word Drasil, then the reader will know right away that this is something different.

smiths avatar May 09 '24 02:05 smiths

@JacquesCarette I updated the function name and comments. Please let me know if it is still not what you are looking for. Here is the updated code:

https://github.com/JacquesCarette/Drasil/blob/111168e78117ca0ec3c523d669a81618e794ddd9/code/drasil-website/lib/Drasil/Website/Example.hs#L236-L241

As for the portion of the path being hardcoded, I followed the existing code used to build the other paths:

https://github.com/JacquesCarette/Drasil/blob/111168e78117ca0ec3c523d669a81618e794ddd9/code/drasil-website/lib/Drasil/Website/Example.hs#L229-L236

Here, portions of the existing code for getCodePath (building the generated code path) and getDoxPath (building the doxygen paths) are hard-coded. I could not find any existing pieces I can use to replace the hard-coded parts and I'm not too sure where or how to add new pieces. One possible solution is to add another path root for the drasil-example directory in the following code; however, the repoCommitRoot path has an identical root, apart from the hard-coded values.

https://github.com/JacquesCarette/Drasil/blob/111168e78117ca0ec3c523d669a81618e794ddd9/code/drasil-website/app/Main.hs#L36-L51

I would appreciate your guidance and recommendation on the approach I should follow to resolve this issue.

BilalM04 avatar May 10 '24 15:05 BilalM04

@JacquesCarette Have you had a chance to look at the changes and comments since you last reviewed?

balacij avatar May 31 '24 17:05 balacij