All Projects → giuseppeg → Xm

giuseppeg / Xm

₪ extensible HTML

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Xm

Metalsmith
An extremely simple, pluggable static site generator.
Stars: ✭ 7,692 (+2381.29%)
Mutual labels:  markdown, markdown-to-html
Markvis
make visualization in markdown. 📊📈
Stars: ✭ 1,509 (+386.77%)
Mutual labels:  markdown, markdown-to-html
Markdeck
presentations as code - author cool slide decks, text-only, offline-ready, collaborative
Stars: ✭ 1,159 (+273.87%)
Mutual labels:  markdown, markdown-to-html
Easy Pandoc Templates
A collection of portable pandoc templates with no dependencies
Stars: ✭ 23 (-92.58%)
Mutual labels:  markdown, markdown-to-html
Markdown
📖Clean & Modern MarkDown Generator, 🔌Offline Support and Easy Generation of Markdown ⚡️⚛️ https://github.com/JP1016/Markdown-Electron/releases
Stars: ✭ 170 (-45.16%)
Mutual labels:  markdown, markdown-to-html
Markitdown
📱 A React app to preview and edit Markdown✍. You can also export it as HTML.
Stars: ✭ 26 (-91.61%)
Mutual labels:  markdown, markdown-to-html
Reversemarkdown Net
ReverseMarkdown.Net is a Html to Markdown converter library in C#. Conversion is very reliable since HtmlAgilityPack (HAP) library is used for traversing the Html DOM
Stars: ✭ 116 (-62.58%)
Mutual labels:  markdown, markdown-to-html
Daux.io
Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.
Stars: ✭ 603 (+94.52%)
Mutual labels:  markdown, markdown-to-html
Lowdown
simple markdown translator
Stars: ✭ 153 (-50.65%)
Mutual labels:  markdown, markdown-to-html
Mdtool
A tool which can process markdown to HTML
Stars: ✭ 136 (-56.13%)
Mutual labels:  markdown, markdown-to-html
Docpress
Documentation website generator
Stars: ✭ 815 (+162.9%)
Mutual labels:  markdown, markdown-to-html
Markdown
A Python implementation of John Gruber’s Markdown with Extension support.
Stars: ✭ 2,725 (+779.03%)
Mutual labels:  markdown, markdown-to-html
Zola
A fast static site generator in a single binary with everything built-in. https://www.getzola.org
Stars: ✭ 7,823 (+2423.55%)
Mutual labels:  markdown, markdown-to-html
Markdown
A super fast, highly extensible markdown parser for PHP
Stars: ✭ 945 (+204.84%)
Mutual labels:  markdown, markdown-to-html
Marker
🖊 A gtk3 markdown editor
Stars: ✭ 644 (+107.74%)
Mutual labels:  markdown, markdown-to-html
Macdown
Open source Markdown editor for macOS.
Stars: ✭ 8,855 (+2756.45%)
Mutual labels:  markdown, markdown-to-html
Pico
Pico is a stupidly simple, blazing fast, flat file CMS.
Stars: ✭ 3,494 (+1027.1%)
Mutual labels:  markdown, markdown-to-html
Mditor
📝 [ M ] arkdown + E [ ditor ] = Mditor
Stars: ✭ 523 (+68.71%)
Mutual labels:  markdown, markdown-to-html
Flexmark Java
CommonMark/Markdown Java parser with source level AST. CommonMark 0.28, emulation of: pegdown, kramdown, markdown.pl, MultiMarkdown. With HTML to MD, MD to PDF, MD to DOCX conversion modules.
Stars: ✭ 1,673 (+439.68%)
Mutual labels:  markdown, markdown-to-html
Markdig
A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
Stars: ✭ 2,730 (+780.65%)
Mutual labels:  markdown, markdown-to-html

₪ xm - extensible HTML

xm is a tiny compiler for HTML that adds

  • <import> tag to inline external HTML files
  • <slot> and <fill> tags to define slots and fill them with content
  • <markdown> tag to portal into Markdown

screenshot of an html template with slots

screenshot of an html page that imports the previous example and fills the slots

xm CLI comes with a dev mode that compiles and serves built HTML.

Furthermore xm is built on top of posthtml-cli and therefore it is extensible.

Are you using xm? Share your site's URL here.

Install

npm i -g xm

Usage

Usage: xm <command> [options]

Commands:

  dev     Compiles HTML files on change and serves the root folder
  build   Compiles the HTML files once
  help    Displays help

Options:

  --root       Folder to compile (default ./)
  --output     Output (destination) folder. This is necessary only when using xm build
  --htmlOnly   Compile and copy only the built HTML files

<import> element

Allows to inline (import) HTML files into the current one.

<import src="file.html" />

Paths are relative.

<!-- src/folder/index.html -->

<import src="file.html" />
<!-- file.html -> src/folder/file.html -->

You can prefix paths with / to make them absolute i.e. relative to the --root value.

$ xm build --root ./src
# <import src="file.html" />
# -> ./src/file.html

Importing markdown files

xm supports importing .md (markdown) files too. When importing such files the front matter declarations are converted to fill elements.

<style>
  /* theme */
</style>
<import src="README.md" />

💡 This feature can be used to generate styled docs sites for your open source project!

If you create a reusable theme for README-like files we encourage you to use the following naming convention:

xm-theme-<theme-name>

Share your site or theme URL here.

<slot> and <fill> elements

HTML files can define slot elements with an attribute name. slots can be filled when importing HTML files using the fill tag.

<!-- base.html -->

<!DOCTYPE html>
<title><slot name="title"></slot></title>
<main>
  <slot name="main"></slot>
</main>

<!-- about.html -->

<import src="base.html">
  <fill name="title">About</fill>
  <fill name="main">
    <h1>About</h1>
    <p>welcome</p>
  </fill>
</import>
<footer>Unique to this page</footer>

<!-- about.html (compiled with xm) -->

<!DOCTYPE html>
<title>About</title>
<main>
  <h1>About</h1>
  <p>welcome</p>
</main>
<footer>Unique to this page</footer>

You can also define a special unnamed slot that will be filled with the import children that are not fill tags:

<!-- base.html -->

<slot></slot>
<footer><slot name="footer"></slot></footer>

<!-- about.html -->

<import src="base.html">
  <fill name="footer">good bye</fill>
  hello
  <p>friend</p>
</import>

<!-- about.html (compiled with xm) -->

hello
<p>friend</p>
<footer>good bye</footer>

Credits

  • Ivan Demidov for helping me out with PRs and PostHTML
  • askucher for transferring ownership of the xm package
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].