GithubHelp home page GithubHelp logo

Semantic HTML about google-code-prettify HOT 6 OPEN

axtutuu avatar axtutuu commented on June 25, 2024
Semantic HTML

from google-code-prettify.

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
I think semantic markup advocates have many good ideas, but it is not a goal of 
this
project to promote semanticness or any other markup layout methodology.
While I think avoiding the need for an explicit onload call is good, this 
project has
too many clients to change the API that radically now.

Could a wrapper script help make it easier for those who want to use semantic 
HTML to
use this code?

Original comment by [email protected] on 6 Jan 2009 at 6:34

from google-code-prettify.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
I understand why you don't want to change the function of the script in order 
to keep 
backwards compatibility. I would propose making the code more configurable, so 
that 
the user of the script can decide how they want it to behave.

A few configurable variables could be added to the top of the script, one for 
configuring what tags/classes should be prettified, and one that decides how 
the 
prettify engine should be initialized. The current method of calling 
prettyPrint() on 
load is noticably "slower" (onload code might be triggered several seconds 
later in 
the browser than using the method in my aforementioned code to detect DOM 
load.) But 
since it's, as you say, used in many older clients, it could be kept the 
default 
behavior.

Original comment by andreasblixt on 6 Jan 2009 at 8:17

from google-code-prettify.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
I agree that it is a Good Idea to promote semantic HTML. According to the HTML5 
spec, code should have the class ".language-*". I modified prettify to do this 
<http://github.com/ariofrio/google-code-prettify>. You can find a thorough 
description of the changes in 
<http://github.com/ariofrio/google-code-prettify/blob/master/CHANGES.ariofrio>.

I also support the idea to make the script more configurable, allowing it to be 
called on DOM load.

Original comment by [email protected] on 1 Nov 2010 at 12:05

from google-code-prettify.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
Actually, take that code with a grain of salt, since it breaks a few things. I 
am currently investigating the source of the misbehaviours.

Original comment by [email protected] on 1 Nov 2010 at 1:49

from google-code-prettify.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
Are you referring to 4.6.11 ( 
http://www.w3.org/TR/html5/text-level-semantics.html#the-code-element ) :

    Although there is no formal way to indicate the language
    of computer code being marked up, authors who wish to
    mark code elements with the language used, e.g. so that
    syntax highlighting scripts can use the right rules, may do
    so by adding a class prefixed with "language-" to the element.

You say "should," whereas that section of HTML5 says "may."
Am I missing a section with stronger language?

Original comment by [email protected] on 1 Nov 2010 at 2:55

from google-code-prettify.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
Of course, when I said should, I meant in my opinion. The point is that it 
would be great to be able to configure these things to cater to different 
environments, HTML5-following or not.

Original comment by [email protected] on 29 Jan 2011 at 8:46

from google-code-prettify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.