feat: custom KaTeX macro #9779

Merged
thatonecalculator merged 19 commits from naskya/calckey:feat/katex-macro into develop 2 months ago

Closes: #9759

Closes: #9759
naskya added 15 commits 2 months ago
Poster

As I wrote in the Matrix chat room, I implemented this by creating preprocess.ts. I said that I wanted to add dependencies, but I could avoid that. So the dependencies are unchanged.

As I wrote in the Matrix chat room, I implemented this by creating `preprocess.ts`. I said that I wanted to add dependencies, but I could avoid that. So the dependencies are unchanged.
naskya added 1 commit 2 months ago
naskya added 1 commit 2 months ago
naskya added 1 commit 2 months ago
thatonecalculator reviewed 2 months ago
@ -940,2 +940,4 @@
defaultReaction: "Default emoji reaction for outgoing and incoming posts"
license: "License"
customKaTeXMacro: "Custom KaTeX Macro"
customKaTeXMacroDescription: "Set up macros to write mathematical expressions easily! The notation conforms to the LaTeX command definitions and is written as \\newcommand{\\name}{content} or \\newcommand{\\name}[number of arguments]{content}. For example, \\newcommand{\\add}[2]{#1 + #2} will expand \\add{3}{foo} to 3 + foo. The curly brackets surrounding the macro name can be changed to round or square brackets. This affects the brackets used for arguments. One (and only one) macro can be defined per line, and you can't break the line in the middle of the definition. Invalid lines are simply ignored. Only simple string substitution functions are supported; advanced syntax, such as conditional branching, cannot be used here."

I don't think fluff like "Set up macros to write mathematical expressions easily!" is needed, the description should only be a sentence or two long and briefly explain what it does rather than giving a long paragraph.

I don't think fluff like "Set up macros to write mathematical expressions easily!" is needed, the description should only be a sentence or two long and briefly explain what it does rather than giving a long paragraph.
panos commented 2 months ago
Owner

TBH I think I like it this way. The first sentence describes the function, which is useful because if I just saw "Custom Katex Macro" in my Settings I would have no idea what it is, except if I cared enough to google it. Describing what it does informs the user if it's something useful to them or not. By nature, this feature needs a good explanation, otherwise you won't understand how it works. So I think that cutting it down to 1-2 sentences would just leave useful info outside - I think that even the example helps explain how the feature works. I think it won't bother anyone, it's just a paragraph and it's inside the page - you don't need to see or read it if you don't open the relevant Katex macro settings page.

TBH I think I like it this way. The first sentence describes the function, which is useful because if I just saw "Custom Katex Macro" in my Settings I would have no idea what it is, except if I cared enough to google it. Describing what it does informs the user if it's something useful to them or not. By nature, this feature needs a good explanation, otherwise you won't understand how it works. So I think that cutting it down to 1-2 sentences would just leave useful info outside - I think that even the example helps explain how the feature works. I think it won't bother anyone, it's just a paragraph and it's inside the page - you don't need to see or read it if you don't open the relevant Katex macro settings page.
Poster

I wrote the description with the same idea as @panos, but I also understand that the huge info box doesn't look very good. I wonder what I should do...

I wrote the description with the same idea as @panos, but I also understand that the huge info box doesn't look very good. I wonder what I should do...
Poster

I don't think I can shorten the description very much. Yes, some adverbs/adjectives are unnecessary, the first sentence and the example could be removed, and good English writers can rewrite the sentence more concisely (I'm very bad at this), but that's all. The other information I included is strictly necessary, as I only implemented the function indicated by the red arrow.

If the description doesn't show what's available clearly, users may think that some macro doesn't work a bug and send bug reports, which I want to avoid.

I don't think I can shorten the description very much. Yes, some adverbs/adjectives are unnecessary, the first sentence and the example could be removed, and good English writers can rewrite the sentence more concisely (I'm very bad at this), but that's all. The other information I included is strictly necessary, as I only implemented the function indicated by the red arrow. If the description doesn't show what's available clearly, users may think that some macro doesn't work a bug and send bug reports, which I want to avoid. ![](https://media.discordapp.net/attachments/823878222897741868/1090797360176709672/IMG_D54772F65471-1.jpg)
naskya added 1 commit 2 months ago
naskya force-pushed feat/katex-macro from 182e4206a0 to 99a0c192be 2 months ago
naskya added 1 commit 2 months ago
thatonecalculator merged commit 9489543180 into develop 2 months ago
naskya deleted branch feat/katex-macro 2 months ago
The pull request has been merged as 9489543180.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b naskya-feat/katex-macro develop
git pull feat/katex-macro

Step 2:

Merge the changes and update on Forgejo.
git checkout develop
git merge --no-ff naskya-feat/katex-macro
git push origin develop
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: calckey/calckey#9779
Loading…
There is no content yet.