ArticleslgStudy

computer science

Lightweight markup language

Lightweight markup language is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Lightweight markup language rather than just read about it. In short: A lightweight markup language (LML), also termed a simple or humane markup language, is a markup language with simple, unobtrusive syntax. It is designed to be easy to write using any generic text editor and easy to read in its raw form.

Key takeaways

  • Lightweight markup language belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Lightweight markup language to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Lightweight markup language from memory before moving on to harder problems.

Reference excerpt

A lightweight markup language (LML), also termed a simple or humane markup language, is a markup language with simple, unobtrusive syntax. It is designed to be easy to write using any generic text editor and easy to read in its raw form. It is used in applications where it may be necessary to read the raw document and the final rendered output. For instance, a person downloading a software library might prefer to read the documentation in a text editor rather than a web browser. Another use for such languages is to provide for data entry in web-based publishing, as in blogs and wikis, where the input interface is a simple text box. The server software then converts the input into a common document markup language like HTML.

History Lightweight markup languages were originally used on text-only displays which could not display characters in italics or bold, so informal methods to convey this information had to be developed. This formatting choice was naturally carried forth to plain-text email communications. Console browsers may also resort to similar display conventions. In 1986 international standard SGML provided facilities to define and parse lightweight markup languages using grammars and tag implication. The 1998 W3C XML is a profile of SGML that omits these facilities. However, no SGML document type definition (DTD) for any of the languages listed below is known.

Types Lightweight markup languages can be categorized by their tag types. Like HTML (<b>bold</b>), some languages use named elements that share a common format for start and end tags (e.g., BBCode [b]bold[/b]), whereas proper lightweight markup languages are restricted to ASCII-only punctuation marks and other non-letter symbols for tags, but some also mix both styles (e.g., Textile bq.) or allow embedded HTML (e.g., Markdown), possibly extended with custom elements (e.g., MediaWiki <ref>'''source'''</ref>). Most languages distinguish between markup for lines or blocks and for shorter spans of texts, but some only support inline markup. Some markup languages are tailored for a specific purpose, such as documenting computer code (e.g., POD, reST, RD) or being converted to a certain output format (usually HTML or LaTeX) and nothing else, others are more general in application. This includes whether they are oriented on textual presentation or on data serialization. Presentation oriented languages include AsciiDoc, atx, BBCode, Creole, Crossmark, Djot, Epytext, Haml, JsonML, MakeDoc, Markdown, Org-mode, POD (Perl), reST (Python), RD (Ruby), Setext, SiSU, SPIP, Xupl, Texy!, Textile, txt2tags, UDO and Wikitext. Data serialization oriented languages include Curl (homoiconic, but also reads JSON; every object serializes), JSON, and YAML.

Comparison of language features

Markdown's own syntax does not support class attributes or id attributes; however, since Markdown supports the inclusion of native HTML code, these features can be implemented using direct HTML. (Some extensions may support these features.) txt2tags' own syntax does not support class attributes or id attributes; however, since txt2tags supports inclusion of native HTML code in tagged areas, these features can be implemented using direct HTML when saving to an HTML target. DokuWiki does not support HTML import natively, but HTML to DokuWiki converters and importers exist and are mentioned in the official documentation. DokuWiki does not support class or id attributes, but can be set up to support HTML code, which does support both features. HTML code support was built-in before release 2023-04-04. In later versions, HTML code support can be achieved through plug-ins, though it is discouraged.

Comparison of implementation features

Comparison of lightweight markup language syntax

Inline span syntax Although usually documented as yielding italic and bold text, most lightweight markup processors output semantic HTML elements em and strong instead. Monospaced text may either result in semantic code or presentational tt elements. Few languages make a distinction, e.g., Textile, or allow the user to configure the output easily, e.g., Texy. LMLs sometimes differ for multi-word markup where some require the markup characters to replace the inter-word spaces (infix). Some languages require one character as prefix and suffix, others need two or even three, or support both with slightly different meaning, e.g., different levels of emphasis.

Gemtext does not have any inline formatting, monospaced text (called preformatted text in the context of Gemtext) must have the opening and closing ``` on their own lines.

Emphasis syntax In HTML, text is emphasized with the <em> and <strong> element types, whereas <i> and <b> traditionally mark up text to be italicized or bold-faced, respectively. Microsoft Word and Outlook, and accordingly other word processors and mail clients that strive for a similar user experience, support the basic convention of using asterisks for boldface and underscores for italic style. While Word removes the characters, Outlook retains them.

Editorial syntax In HTML, removed or deleted and inserted text is marked up with the <del> and <ins> element types, respectively. However, legacy element types <s> or <strike> and <u> are still also available for stricken and underlined spans of text.

AsciiDoc, ATX, Creole, MediaWiki, PmWiki, reST, Slack, Textile and WhatsApp do not support dedicated markup for underlining text. Textile does, however, support insertion via the +inserted+ syntax.

ATX, Creole, MediaWiki, PmWiki, reST and Setext do not support dedicated markup for striking through text. DokuWiki supports HTML-like <del>stricken</del> syntax, even with embedded HTML disabled. AsciiDoc supports stricken text through a built-in text span prefix: [.line-through]#stricken#.

Programming syntax Quoted computer code is traditionally presented in typewriter-like fonts where each character occupies the same fixed width. HTML offers the semantic <code> and the deprecated, presentational <tt> element types for this task.

Mediawiki and Gemtext do not provide lightweight markup for inline code spans.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Lightweight markup language

Start with the simplest possible case. Write down what Lightweight markup language claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Lightweight markup language before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Lightweight markup language ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Lightweight markup language

In research
Lightweight markup language appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Lightweight markup language in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Lightweight markup language is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computing-related lists, Data serialization formats, Lightweight markup languages, so understanding it makes those chapters shorter.
In everyday life
Look for Lightweight markup language outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Lightweight markup language in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Lightweight markup language means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Lightweight markup language out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Lightweight markup language in simple terms?

A lightweight markup language (LML), also termed a simple or humane markup language, is a markup language with simple, unobtrusive syntax. It is designed to be easy to write using any generic text editor and easy to read in its raw form.

Why does Lightweight markup language matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Lightweight markup language?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Lightweight markup language.

Tags

  • Computing-related lists
  • Data serialization formats
  • Lightweight markup languages
  • Markup language comparisons
  • Markup languages

Keep exploring