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

scdoc: adding subsubsection, audio, video, text decoration, some HTML tags, LaTex syntax and MathML syntax #6254

Conversation

prko
Copy link
Contributor

@prko prko commented Apr 15, 2024

Purpose and Motivation

To make the SCDoc (SuperCollider help documents) more user friendly, I added subsubsections (soft-coded), some HTML tags, LaTex and MathML.

Types of changes

  • Documentation
  • New feature

To-do list

  • Code is tested
  • All tests are passing
  • Updated documentation
  • This PR is ready for review, but this PR may change dynamically as other users provide feedback.

link to related SCDoc update
link added to related SCDoc
link added to relared SCDoc
- added link to related SCDoc
- A guide to using some HTML, LaTeX and MathML syntax is mentioned
WritingHelp_HTML_LaTeX_MathML
added documentation for subsubsection and some HTML LaTeX and MathML
added subsubsection, some html tags, LaTeX and MathML
@prko prko changed the title Topic/scdoc subsubsection audio video text decoration scdoc: adding subsubsection, audio, video, text decoration, HTML tags, LaTex and MathML Apr 15, 2024
@prko prko changed the title scdoc: adding subsubsection, audio, video, text decoration, HTML tags, LaTex and MathML scdoc: adding subsubsection, audio, video, text decoration, some HTML tags, LaTex syntax and MathML syntax Apr 16, 2024
typo correction and adding missed part
Copy link
Contributor

@nhthn nhthn left a comment

Choose a reason for hiding this comment

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

I have my doubts over whether SCDoc should be expanded to keep glomming on new features, but more importantly: I'm afraid modifying the generated HTML with tons of .replace calls isn't the right way to do this. The correct way to extend SCDoc syntax is to modify the SCDoc parser and HTML generator in the SCDoc directory. Unfortunately, as written, this is very fragile and hacky.

- typo correction
- added alternative bracket section
reader-friendly screenshot
- reduced repetition of `.replace
- fix: jump to link in TOC now works even if non-Roman alphabets are included in section and subsection.
@prko
Copy link
Contributor Author

prko commented Apr 17, 2024

@nhthn

Thank you for your valuable feedback!

I have my doubts over whether SCDoc should be expanded to keep glomming on new features, but more importantly: I'm afraid modifying the generated HTML with tons of .replace calls isn't the right way to do this. The correct way to extend SCDoc syntax is to modify the SCDoc parser and HTML generator in the SCDoc directory. Unfortunately, as written, this is very fragile and hacky.

  • To: I have my doubts over whether SCDoc should be expanded to keep glomming on new features.
    1. With the focus on new features, some of the new features I suggest are not always necessary. I can remove them if one of the reviewers points out the specific feature.
    2. However, I think your thoughts here are more focused on extending SCDoc, there is no way to implement the features I suggest without extending SCDoc, if I understand its system correctly. So I think the core issue is whether or not these features are needed in SuperCollider's help document browser.
    3. My position is that they are necessary if the SC help browser is to be easily readable by newcomers.
    4. Also, some Quarks contain long and complicated documentations, tutorials and guides; I think the new feature proposed here would help to formulate these documents in a reader-friendly and author-friendly way.
  • To: I'm afraid modifying the generated HTML with tons of .replace calls isn't the right way to do this. Unfortunately, as written, this is very fragile and hacky.
    In 288a1c8, I reduced the repetition of .replace by adding a method.
    There is one thing I should mention: the previous version, untouched by me, already has .replace:
    *escapeSpacesInAnchor { |str|
    ^str.replace(" ", "%20")
    }
    At first glance this appears to be a one-off, but the method is used frequently throughout SCDocRenderer.sc.
  • To: The correct way to extend SCDoc syntax is to modify the SCDoc parser and HTML generator in the SCDoc directory.
    Um... I don't know how to do it... Sorry, but I beg you to understand that I spent a lot of time (almost two weeks due to the implementation of replaceRegex with two .*. I finally gave up) trying to solve some implementation problems. If you give me more tips on how to do it, I can learn the way and try to achieve it!

prko added 10 commits April 17, 2024 11:57
Added files to make LaTex and MathML available when there is no internet connection.
Added a folder to add files to make LaTex and MathML available when there is no internet connection.
Added files to make LaTex and MathML available when there is no internet connection.
Added files to make LaTex and MathML available when there is no internet connection.
…net connection.

Added files to make LaTex and MathML available when there is no internet connection.
@prko prko requested a review from nhthn April 17, 2024 05:01
@prko
Copy link
Contributor Author

prko commented Apr 17, 2024

@jrsurge
Copy link
Member

jrsurge commented Apr 17, 2024

Thanks for this - I can appreciate how much work has gone into this.

Unfortunately, apart from the concerns already raised, this PR is too big to review - I do not think it can be accepted in its current form.

If this is something you would like to continue with, can you please break it up into smaller, functional PRs, that each add one change?

I understand that this is a lot of work, but it takes as much work to review it effectively, and it is asking a lot of others working on the Project.

If you would like to discuss breaking it up, please let me know - but there is a question that needs to be answered first about whether this is the right direction for the Project, and I'm not sure at this point. I am also more than happy to discuss this as well, so please feel free to contact me if I can help.

@prko
Copy link
Contributor Author

prko commented Apr 17, 2024

@jrsurge

If this is something you would like to continue with, can you please break it up into smaller, functional PRs, that each add one change?

Yes, I can do that (even though the implementations are in an SC file SCDocRenderer.sc). Would the following be acceptable?

  • subsubsection (soft-coded): SCDocRenderer.sc.
  • LaTeX: SCDocRenderer.sc and offline access files.
  • HTML tags support (br, small, strong, emphasis, sup, sub, table, hr, audio, video, iframe etc.) as well as MathML*: SCDocRenderer.sc.
    (I have found a way to display mathematical expressions using LaTeX also in teletype. So, I do not need to implement MathML, but MathML seems a standard in HTML.)
  • predefined brackets for text body outside code and codeblock: SCDocRenderer.sc.
  • Documentation: WritingHelp_HTML_LaTeX_MathML.schelp

Or should it be split into smaller parts?

but there is a question that needs to be answered first about whether this is the right direction for the Project, and I'm not sure at this point.

My general thoughts:
The new features are necessary, even if the implementation is not always ideal.

  • I think the integration of LaTeX (and MathML for mathematical expressions in teletype text) is very useful and saves a lot of time (no need to export images in LaTeXiT). The implementation seems OK, but many of the uploaded files for offline access to the MathJax script may be unnecessary.
  • The implementation of a subsubsection is also needed to structure large documentation. This should of course be hard coded. However, I do not understand C++, and I raised this issue several years ago, but nothing has changed. For now, and with my current coding skills, a soft-coded implementation is best.
  • HTML tag support is not good, because ideally it should be implemented as SCDoc syntax. But SCDoc syntax is hard-coded. I cannot do it... From the point of view of LaTeX integration, mixing HTML syntax is not bad. For now, and with my current programming skills, a soft-coded implementation is the best.

@prko
Copy link
Contributor Author

prko commented Apr 21, 2024

I close this, and will make separate PRs.

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.

None yet

3 participants