php-markdown icon indicating copy to clipboard operation
php-markdown copied to clipboard

fenced DIV

Open mdan312 opened this issue 10 years ago • 9 comments

What about creating a "fenced" DIV ? We simply need something similar with the syntaxe used for <code> blocks...

I suggest

:::::::::::::::::::::::::::::::::{ .myClass #myId}
my div
::::::::::::::::::::::::::::::::::

It would open many possibilities and avoid the awfull

<div class="myClass" id="myId" markdown="1">

it really sucks in a readMe.md files!!!

mdan312 avatar Jan 23 '15 21:01 mdan312

I understand writing <div ...> sucks in your particular situation, but I don't really see replacing <div ...> with ::::::{ ... } as a big improvement in clarity or legibility.

Another problem with adding new syntaxes is that it never ends. Today it's div, tomorrow it'll be aside, section, kbd, sup, sub, or anything else you can pick in the HTML spec. Anything we add should be a substantive improvement over plain HTML.

michelf avatar Jan 23 '15 21:01 michelf

Well DIV is the basic "BLOCK" structure in HTML. It is largely used with CSS for many tasks:

For example when you quote various kind of books: (People who use MarkDown are not only developpers!!!) Just compare one page I was just building:


Marriage in various cultures
------------------------------------

In a christian point of view .... based on the following verse:

::::::::::::::::::::: {.Bible}
Husbands, love your wives, 
just as Christ loved the church 
and gave himself up for her. 
::::::::::::::::::::::::::

.... bla bla ...

::::::::::::::::::::: {.Bible}
God is love.
::::::::::::::::::::::::::

Adoption ... bla bla bla bla bla bla bla bla bla bla
 ... by the following verse:

::::::::::::::::::::: {.Quran}
 So when Zayd had no longer any need for her, 
We married her to you in order that there not be upon the believers 
any discomfort concerning the wives of their adopted sons 
when they no longer have need of them. 
::::::::::::::::::::::::::

In Buddhism, ...

::::::::::::::::::::: {.otherBook}
Bla bla Bla bla Bla bla
Bla blaBla bla Bla bla Bla 
::::::::::::::::::::::::::

mdan312 avatar Jan 23 '15 22:01 mdan312

DIV can also be used to design many other things with CSS!!!!

::::::::::::::::::::::::::::: {.MenuBar}
- item1
- item2
- item3
- item4
::::::::::::::::::::::::::::::

mdan312 avatar Jan 23 '15 22:01 mdan312

@michelf : DIV are the low level structure to design everything in CSS!

::::::::::::::::::::::::::: {.red}
my red text. 
Because it is important.
::::::::::::::::::::::::::::::

::::::::::::::::::::::::::: {.green}
my green text. 
Because I am talking about nature.
::::::::::::::::::::::::::::::

::::::::::::::::::::::::::: {.big}
Large fonts. 
Because I am shouting!
::::::::::::::::::::::::::::::

::::::::::::::::::::::::::: {.new}
my new text. 
it has just been added.
::::::::::::::::::::::::::::::


::::::::::::::::::::::::::: {.framed}
my framed text. 
I just like it
::::::::::::::::::::::::::::::

::::::::::::::::::::::::::: {.suppressed}
my former text. 
I've just suppressed this §
::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::{#question}
What about improving Markdown?
::::::::::::::::::::::::::::::

::::::::::::::::::::::{#answer}
Well...
We need to convince @michelf !!
::::::::::::::::::::::::::::::


mdan312 avatar Jan 23 '15 22:01 mdan312

@kanzeon : how do you feel about that suggestion? It is more readable than kramdown syntax isn't it?

mdan312 avatar Jan 23 '15 23:01 mdan312

Actually, in your first examples you should use <blockquote>, not <div>. In your second example, you should use <nav>, not <div>. In your third example, you should use <ins> and <del> instead of using <div> with classes new and suppressed, and depending on the actual context the framed class possibly should use <aside> instead of <div>. Please refer to the HTML specification for explanation of those elements if you don't know them already.

I know it is sometime justified to use a <div> when writing a document, and for that Markdown lets you insert a <div> whenever you need it. But because <div> has its uses sometime doesn't necessarily mean it deserves a special Markdown syntax. In fact, you just made me realize that granting a special syntax for <div> would encourage people to use that in replacement of using the prescribed HTML tag. So I'm not going to add a special syntax for <div>.

michelf avatar Jan 23 '15 23:01 michelf

maybe a "fenced" blockquote then?

mdan312 avatar Jan 23 '15 23:01 mdan312

Why should it be fenced? If you want to allow attributes on a blockquote that could be done without adding a fence.

michelf avatar Jan 24 '15 01:01 michelf

Well it would be useful then...

mdan312 avatar Jan 27 '15 22:01 mdan312