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

Support an easy syntax for bigger/smaller text size #28

Closed
damithc opened this issue Apr 3, 2017 · 27 comments · Fixed by #1473
Closed

Support an easy syntax for bigger/smaller text size #28

damithc opened this issue Apr 3, 2017 · 27 comments · Fixed by #1473

Comments

@damithc
Copy link
Contributor

damithc commented Apr 3, 2017

Currently we use block quote formatting to show text in bigger size. This is an abuse of syntax. Instead, we should tweak the block quote formatting to actually look like quotes as we do have an actual use case for showing quotes in our eContent.

On the other hand, we could support an easy syntax to indicate whether to make text bigger/smaller relative to the default size. e.g. +++ ---

@acjh
Copy link
Contributor

acjh commented Apr 1, 2018

Hmm, I don't see this being abused in CS2103/T Website — didn't know there were so many quotes!
I used this regex: ^>␣ (unsubstitute with a whitespace)

Not sure about the use case here. Can we stick to headings for this?

@rachx
Copy link
Contributor

rachx commented Apr 1, 2018

image
I used <span style="font-size: smaller"> MarkBind </span> (and larger for the next one)

@damithc
Copy link
Contributor Author

damithc commented Apr 1, 2018

Hmm, I don't see this being abused in CS2103/T Website — didn't know there were so many quotes!

IIRC, the text size was adjusted later to be of normal size, and the abuse stopped :-)

Not sure about the use case here. Can we stick to headings for this?

I thought showing some text larger than normal can be used to indicate more important part of the text e.g., a paragraph that gives a high-level overview of the rest. I've seen some Web articles using that technique. The objective is if the reader is in a hurry, she can only read those bigger text parts.

I used <span style="font-size: smaller"> MarkBind </span> (and larger for the next one)

Yup, we can use that for the time being. It's more convenient if we have a shorter syntax though.

@acjh
Copy link
Contributor

acjh commented May 15, 2018

How about <small> (from Bootstrap) and <big> (define as font-size: larger in markbind.css)?

@damithc
Copy link
Contributor Author

damithc commented May 15, 2018

Sure. is something like this possible? <small> <smaller> <large> <larger>

@acjh
Copy link
Contributor

acjh commented May 15, 2018

You can nest <big> and <small>:

<big><big>tutorial</big>tutorial</big>tutorial<small>tutorial<small>tutorial</small></small>

28-1

@damithc
Copy link
Contributor Author

damithc commented May 15, 2018

Nice. In that case, should they be bigger and smaller, which gives the sense of cumulative effect?

@acjh
Copy link
Contributor

acjh commented May 15, 2018

<small> is a standard HTML5 element though.

@damithc
Copy link
Contributor Author

damithc commented May 15, 2018

OK, we'll go with that then.

@damithc
Copy link
Contributor Author

damithc commented Dec 24, 2018

I'm OK with <big> and <small>. However, <big> is deprecated in HTML5. Should we add a replacement tag?

@damithc
Copy link
Contributor Author

damithc commented Dec 24, 2018

Removing good first issue tag temporarily as the issue is still under discussion.

@damithc damithc added s.UnderDiscussion The team will evaluate this issue to decide whether it is worth adding and removed good first issue labels Dec 24, 2018
@yamgent
Copy link
Member

yamgent commented Dec 24, 2018

Sure. is something like this possible? <small> <smaller> <large> <larger>

Since CSS's font-size property also uses values such as small and large, we can use <large> and <small>,

@Chng-Zhi-Xuan
Copy link
Contributor

Chng-Zhi-Xuan commented May 23, 2019

We can add easily support for <large> tags via markbind.css.

large {
  font-weight: 400;
  font-size: 125%;
}

To simplify the syntax, we can either use markdown-It-regex which is already imported, or markdown-it-container.

Suggestion:

  • Reserve ++ for placing <large> tags (Remove from underline).
  • Reserve -- for placing <small> tags.
  • Reserve __ for underline text (Remove from bold + italics)
  • Use combination of ** and _ for bold + italics (supported natively)
New syntax:
++Larger text++
--smaller text--
__underline text__
**_bold and italic_**, _**bold and italic**_, ***bold and italics***

@Chng-Zhi-Xuan
Copy link
Contributor

Chng-Zhi-Xuan commented May 24, 2019

Note that adopting the suggested syntax will disobey the rules defined within commonMark spec.

So far I could only find Discord to break semantics to support underline text.

We might want to break semantics to support underline as it is a common document style. Discussions on underline text can be found here:

@damithc
Copy link
Contributor Author

damithc commented May 24, 2019

Unfortunately, I guess we want to preserve compatibility with Markdown syntax.

@ang-zeyu
Copy link
Contributor

ang-zeyu commented Aug 8, 2020

How about switching over to $$...$$ for underline text? This is a big deprecation though, so we could aim to support both $$...$$ and ++...++ for underline text till v3.0.

After that, we can adopt the syntax for large / small text suggested above #28 (comment)

++...++ -> large text
--...-- -> small text

@damithc
Copy link
Contributor Author

damithc commented Aug 8, 2020

How about switching over to $$...$$ for underline text? This is a big deprecation though, so we could aim to support both $$...$$ and ++...++ for underline text till v3.0.

Yes, that is possible.

Will there be any issue because ------- is also used for horizontal lines?

Perhaps we can also support ++++text++++ (i.e., even larger) similar to ****text****?

@ang-zeyu
Copy link
Contributor

ang-zeyu commented Aug 8, 2020

Will there be any issue because ------- is also used for horizontal lines?

unlikely, similar to how you can use **...** for bold text but also *** for horizontal lines.

Perhaps we can also support ++++text++++ (i.e., even larger) similar to ****text****?

yes that's possible as well.

Let's go with that then; Also this can be implemented as an independent npm package outside of markbind, there seems to be quite a bit of demand for such a plugin

@ang-zeyu ang-zeyu added c.Feature 🚀 d.moderate and removed c.Enhancement s.UnderDiscussion The team will evaluate this issue to decide whether it is worth adding labels Aug 8, 2020
@fsancho
Copy link

fsancho commented Feb 23, 2021

Can $$ be in conflict with LATEX notation for math?

@ang-zeyu
Copy link
Contributor

thanks for highlighting this @fsancho

I believe it may conflict with external scripts, but we're providing our own using bracket notations \[...\] \(...\) with this package, which should reduce the need for that.

@fsancho
Copy link

fsancho commented Feb 23, 2021

Thanks for replying so fast!
It's true that we can use [...] (...) with TeX packages (and indeed, they are more desirable than $$..$$), but there is not direct way to transform a "classic" doc using $$..$$ and $..$ into a new one with these delimiters, and maybe this fact may impair the use of MarkBind for already formatted content.

@ang-zeyu
Copy link
Contributor

Fair point, hmm...

I suggested $$...$$ originally as we've really almost run out of good delimiters for our text styles unfortunately =\

The alternatives I could think of were # & ! @ which don't seem to connote the same 'squiggly' underline feel.

One potential fix is to expose these delimiters to user configuration for such use cases.
Or we could also shift to !!...!! which at least connotes some semantic value for underlining (in this case 'drawing attention to').

any thoughts as well? @damithc

@damithc
Copy link
Contributor Author

damithc commented Feb 23, 2021

Or we could also shift to !!...!! which at least connotes some semantic value for underlining (in this case 'drawing attention to').

any thoughts as well? @damithc

I'm OK with that notation too.

@wxwxwxwx9
Copy link
Contributor

@ang-zeyu How should we approach this? Should we make the PR for the !!...!! underline syntax change or leave it for now?

@ang-zeyu
Copy link
Contributor

ok, let's go with !!...!! then, if there's no objections.

Thanks for taking a look at this again @wxwxwxwx9

Since $$..$$ is already out there in 2.8, let's do 2 prs, one

  • against the hotfix branch, to add a new rule for !!...!!, and deprecate $$...$$ (also warnings) similarly to ++...++
  • against the main unreleased branch, a straightforward change of $$...$$ to !!...!!

@fsancho
Copy link

fsancho commented Feb 24, 2021

Thanks a lot for taking into consideration my comment/needs! I really apreciate your wonderful work with MarkBind!

@ang-zeyu
Copy link
Contributor

No problem. Thanks for the input as well! 😃

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

Successfully merging a pull request may close this issue.

8 participants