Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • eclipse-wg/asciidoc-wg/asciidoc.org
  • ggrossetie/asciidoc.org
  • marieflorescontact/asciidoc.org
  • mojavelinux/asciidoc.org
  • swhitesal/asciidoc.org
  • aschwartzx7r/asciidoc.org
  • silopolis/asciidoc.org
  • helloworld22/asciidoc.org
  • anisia25/asciidoc.org
  • nathan37/asciidoc.org
  • emonicznykanal/asciidoc.org
  • racemouse/asciidoc.org
  • anishtcoer/asciidoc.org
  • pinotronic/asciidoc.org
  • suresh10apeah/asciidoc.org
  • prodas/asciidoc.org
16 results
Show changes
Commits on Source (80)
Showing with 1083 additions and 2 deletions
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
'use strict'
const cssnano = require('cssnano')
const litePreset = require('cssnano-preset-lite')
const cssnanoPreset = litePreset({ discardComments: false })
const ospath = require('path')
const asciidoctor = require('@asciidoctor/core')()
const autoprefixer = require('autoprefixer')
const postcss = require('postcss')
const postcssPresetEnv = require('postcss-preset-env')
const postcssAtImport = require('postcss-import')
const DocumentModelConverter = require('./lib/document-model-converter.js')
asciidoctor.ConverterFactory.register(new DocumentModelConverter(), ['json'])
module.exports = function (eleventyConfig, rest) {
eleventyConfig.addPassthroughCopy('pages/**/*.{jpg,png,gif,svg,webp,ico,txt,json,webmanifest,xml,woff2}')
eleventyConfig.addPassthroughCopy('pages/_redirects')
eleventyConfig.setBrowserSyncConfig({
files: ['_site/**/*'],
open: false
})
eleventyConfig.addExtension('css', {
outputFileExtension: 'css',
compileOptions: {
cache: false
},
compile: async function (inputContent, inputPath) {
const parsed = ospath.parse(inputPath)
if (parsed.name.startsWith('_')) {
return
}
const result = await postcss([
postcssAtImport,
autoprefixer,
postcssPresetEnv({ browsers: 'defaults,not IE 11' }),
(css, result) => {
result.root.walk((node) => {
if (node.type === 'decl') {
if (node.prop === 'font-display') {
node.remove()
} else if (node.prop === 'src' && node.parent.name === 'font-face') {
if (node.value.includes('.eot')) {
node.parent.remove()
} else {
node.value = node.value.replace(/^.*(url\('.+?\.woff2'\)).*$/, "$1 format('woff2')")
}
}
}
})
return result
},
cssnano({ preset: cssnanoPreset })
])
.process(inputContent, { from: inputPath, to: '_site/assets/css/main.css' })
return async () => {
return result.css
}
}
})
eleventyConfig.addExtension('adoc', {
compile: function (inputContent) {
return function () {
const registry = asciidoctor.Extensions.create()
return asciidoctor.convert(inputContent, {
safe: 'unsafe',
extension_registry: registry,
template_dirs: ospath.join(__dirname, 'templates'),
attributes: {
'skip-front-matter': '',
showtitle: '',
'syntax-highlighter': 'highlight.js',
includedir: ospath.join(__dirname, 'pages', 'examples')
},
backend: 'json'
})
}
}
})
return {
templateFormats: ['njk', 'adoc', 'css'],
dir: {
output: '_site',
input: 'pages',
includes: '_includes',
layouts: '_layouts',
data: '_data'
}
}
}
pages/examples/**
!.eleventy.js
{
"extends": "standard"
}
/_site/
/node_modules/
variables:
GIT_DEPTH: '5'
DEFAULT_NODE_VERSION: '16'
LINUX_DISTRO: bullseye
NPM_CONFIG_CACHE: &npm_cache_dir .cache/npm
NPM_CONFIG_FUND: 'false'
NPM_CONFIG_PREFER_OFFLINE: 'true'
default:
image: node:$DEFAULT_NODE_VERSION-$LINUX_DISTRO
interruptible: true
lint:
before_script:
- node -p '`${os.type()} ${os.release()}\nNode.js ${process.version}`'
- npm ci --quiet
cache:
key: npm-cache
paths:
- *npm_cache_dir
policy: pull
script:
- npm run lint
{
"extends": "stylelint-config-standard",
"rules": {
"max-line-length": null,
"comment-empty-line-before": null,
"no-descending-specificity": null,
"selector-id-pattern": null
},
"ignoreFiles": [
"pages/assets/subfont/**.css"
]
}
This diff is collapsed.
= asciidoc.org
image:https://gitlab.eclipse.org/eclipse-wg/asciidoc-wg/asciidoc.org/badges/main/pipeline.svg[link="https://gitlab.eclipse.org/eclipse-wg/asciidoc-wg/asciidoc.org/-/pipelines",title="pipeline status"]
This repository hosts the source code, content, and build for the https://asciidoc.org site.
The site is generated using https://www.11ty.dev[11ty] and hosted on https://www.netlify.com[Netlify].
== Prerequisites
* https://git-scm.com[git] - to clone this repository
* https://nodejs.org[npm (provided by Node.js 16)] - to install dependencies and to generate and serve the site
== Clone repository
$ git clone https://gitlab.eclipse.org/eclipse-wg/asciidoc-wg/asciidoc.org.git
Once the clone is complete, switch to the newly created directory.
$ cd asciidoc.org
== Install dependencies
$ npm ci
== Run local preview
$ npm start
== Code of Conduct
The asciidoc.org website project is governed by the Eclipse Foundation's https://www.eclipse.org/org/documents/Community_Code_of_Conduct.php[Community Code of Conduct].
When participating in this project, you agree to honor this code.
Let's strive to make this a welcoming, professional, inclusive, and safe environment for everyone.
== Contributing
When contributing to the asciidoc.org website, you agree to license your contributions according to its licenses.
You can contribute changes to this website using a https://gitlab.eclipse.org/help/user/project/merge_requests/index.md[Merge Request].
In order to submit a Merge Request, you must have an Eclipse Foundation account.
Your contribution will be reviewed by members of the AsciiDoc Working Group before it is merged.
Whether that contribution is merged, and in what state, is at the discretion of the AsciiDoc Working Group.
As this project is owned and managed by the AsciiDoc Working Group, it adheres to the https://www.eclipse.org/org/workinggroups/process.php[Working Group Process] defined by the Eclipse Foundation.
== Licenses
This site's source code is made available under the terms of the Eclipse Public License v 2.0 (EPL-2.0).
This site's content, including prose and syntax examples, is made available under the terms of a Creative Commons Attribution 4.0 International License (CC-BY-4.0).
See link:LICENSE.adoc[] to find the full text of the EPL-2.0 and CC-BY-4.0 licenses as well as additional copyright and third-party materials license information.
== Trademarks
AsciiDoc® and AsciiDoc Language™ are trademarks of the Eclipse Foundation, Inc.
# asciidoc.org
= Awesome AsciiDoc
A curated list of software and resources that support the AsciiDoc ecosystem.
.DISCLAIMER
[IMPORTANT]
====
This resource is provided as a service to the AsciiDoc community by the AsciiDoc Working Group.
The AsciiDoc Working Group curates the entries listed on this page.
New entries may be suggested the community at large by submitting a merge request to this repository.
This page is intended to promote AsciiDoc and related technologies by identifying projects that support and benefit the AsciiDoc ecosystem.
*An entry on this page does not equal an endorsement that the software is AsciiDoc compatible as defined by the Eclipse Foundation Specification Process (EFSP) for the AsciiDoc Language.*
Software projects, namely language processors, must meet the compatiblity requirements in order to be granted that title.
====
== Explore
=== Author
Author AsciiDoc content with the help of these tools.
* https://intellij-asciidoc-plugin.ahus1.de/[IntelliJ AsciiDoc Plugin] - A plugin for the IntelliJ platform (IntelliJ IDEA, RubyMine, etc.) that provides support for the AsciiDoc language.
* https://marketplace.visualstudio.com/items?itemName=asciidoctor.asciidoctor-vscode[AsciiDoc for Visual Studio Code] - An extension for VS Code that provides live preview, syntax highlighting, and snippets for the AsciiDoc language using Asciidoctor.
* https://marketplace.eclipse.org/content/asciidoctor-editor[Asciidoctor Editor for Eclipse] - A plugin for the Eclipse IDE that adds text editor support and a preview view for AsciiDoc files.
* https://github.com/asciidoctor/asciidoctor-browser-extension[Asciidoctor Browser Extension] - A browser extension for Chrome/Chromium, Firefox, Opera, and Edge that uses Asciidoctor.js to provide live HTML preview of AsciiDoc files.
* https://github.com/vim/vim/blob/master/runtime/syntax/asciidoc.vim[AsciiDoc syntax for VIM] - Syntax highlighting for AsciiDoc files is included in the Vim text editor, though a https://github.com/habamax/vim-asciidoctor#vim-plug[more comprehensive plugin] is available using vim-plug.
=== Convert
Parse and convert AsciiDoc using these language implementations.
* https://docs.asciidoctor.org/asciidoctor/latest[Asciidoctor] - The leading AsciiDoc language processor, written in Ruby. Asciidoctor maintains the definition of the AsciiDoc language until it can be taken over by the AsciiDoc Language project.
* https://github.com/asciidoctor/asciidoctorj[AsciidoctorJ] - A Java library that runs Asciidoctor on the JVM and provides a Java API.
* https://github.com/asciidoctor/asciidoctor.js[Asciidoctor.js] - A version of Asciidoctor transpiled to JavaScript that includes a porcelain JavaScript API.
* https://github.com/bytesparadise/libasciidoc[libasciidoc] - A Golang library for processing AsciiDoc.
* https://github.com/gmarpons/asciidoc-hs[asciidoc-hs] - A Haskell-based AsciiDoc parser that's designed to be used as a pandoc frontend.
AsciiDoc was originally developed as part of the https://asciidoc-py.github.io[AsciiDoc.py project].
AsciiDoc.py is now a legacy processor for an older rendition of the AsciiDoc syntax.
As such, it will not properly handle the language that is being described by AsciiDoc specification.
Unless you still rely on the AsciiDoc.py toolchain, you should choose a processor that handles the current AsciiDoc syntax.
=== Publish
Publish content from AsciiDoc using these build tools and static site generators.
* https://docs.antora.org[Antora] - A modular, multi-repository site generator designed for creating documentation sites from content composed in AsciiDoc and processed with Asciidoctor.
* https://github.com/asciidoctor/jekyll-asciidoc[Jekyll AsciiDoc] - A Jekyll plugin that converts AsciiDoc source files in your site to HTML pages using Asciidoctor.
* https://github.com/saneef/eleventy-plugin-asciidoc[11ty AsciiDoc] - Eleventy static site generator plugin to add support for AsciiDoc.
* https://jbake.org[JBake] - A Java-based static site and blog generator that can process content written in AsciiDoc.
* https://github.com/asciidoctor/asciidoctor-maven-plugin[Asciidoctor Maven Tools] - A suite of plugins for Apache Maven that convert AsciiDoc source files to HTML and other formats using AsciidoctorJ.
* https://github.com/asciidoctor/asciidoctor-gradle-plugin[Asciidoctor Gradle Plugin] - A plugin for Gradle that converts AsciiDoc source files using AsciidoctorJ.
dist/
#!/bin/bash
OUTDIR=dist
mkdir -p $OUTDIR
# Apple
convert -background none -filter Lanczos -distort resize 180x logo-fill-color.svg $OUTDIR/asciidoc-logo-apple-touch-180.png
# Microsoft
convert -background none -filter Lanczos -distort resize 70x logo-fill-white.svg $OUTDIR/asciidoc-logo-mstile-70.png
convert -background none -filter Lanczos -distort resize 150x logo-fill-white.svg $OUTDIR/asciidoc-logo-mstile-150.png
convert -background none -gravity center -extent 310x150 $OUTDIR/asciidoc-logo-mstile-150.png $OUTDIR/asciidoc-logo-mstile-310x150.png
convert -background none -filter Lanczos -distort resize 310x logo-fill-white.svg $OUTDIR/asciidoc-logo-mstile-310.png
# Standard
convert -background none -filter Lanczos -distort resize 512x logo-fill-color.svg $OUTDIR/asciidoc-logo-512.png
convert -background none -filter Lanczos -distort resize 196x logo-fill-color.svg $OUTDIR/asciidoc-logo-196.png
convert -background none -filter Lanczos -distort resize 192x logo-fill-color.svg $OUTDIR/asciidoc-logo-192.png
convert -background none -filter Lanczos -distort resize 128x logo-fill-color.svg $OUTDIR/asciidoc-logo-128.png
convert -background none -filter Lanczos -distort resize 96x logo-fill-color.svg $OUTDIR/asciidoc-logo-96.png
convert -background none -filter Lanczos -distort resize 64x logo-fill-color.svg $OUTDIR/asciidoc-logo-64.png
convert -background none -filter Lanczos -distort resize 48x logo-fill-color.svg $OUTDIR/asciidoc-logo-48.png
convert -background none -filter Lanczos -distort resize 32x logo-fill-color.svg $OUTDIR/asciidoc-logo-32.png
convert -background none -filter Lanczos -distort resize 16x -unsharp 0x1+.5+.25 logo-fill-color.svg $OUTDIR/asciidoc-logo-16.png
icotool -c -o $OUTDIR/favicon.ico \
$OUTDIR/asciidoc-logo-64.png \
$OUTDIR/asciidoc-logo-48.png \
$OUTDIR/asciidoc-logo-32.png \
$OUTDIR/asciidoc-logo-16.png
<svg width="197" height="197" viewBox="0 0 197 197" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 112.891V36.1574L44.028 112.891H0Z" fill="#1F8197"/>
<path d="M0 146.258V176.993C0 187.507 8.52314 196.03 19.037 196.03H91.7307L63.1729 146.258H0Z" fill="#1F8197"/>
<path d="M101.642 146.258L127.594 191.488C151.391 183.964 171.262 167.604 183.355 146.258H101.642Z" fill="#1F8197"/>
<path d="M194.908 112.891C195.647 108.04 196.03 103.072 196.03 98.015C196.03 43.8828 152.147 0 98.015 0H19.037C18.6037 0 18.1737 0.0144811 17.7475 0.0429857L82.497 112.891H194.908Z" fill="#1F8197"/>
</svg>
<svg width="197" height="197" viewBox="0 0 197 197" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 112.891V36.1574L44.028 112.891H0Z" fill="white"/>
<path d="M0 146.258V176.993C0 187.507 8.52314 196.03 19.037 196.03H91.7307L63.1729 146.258H0Z" fill="white"/>
<path d="M101.642 146.258L127.594 191.488C151.391 183.964 171.262 167.604 183.355 146.258H101.642Z" fill="white"/>
<path d="M194.908 112.891C195.647 108.04 196.03 103.072 196.03 98.015C196.03 43.8828 152.147 0 98.015 0H19.037C18.6037 0 18.1737 0.0144811 17.7475 0.0429857L82.497 112.891H194.908Z" fill="white"/>
</svg>
node_modules/
dist/
data/images/img/book-taming-thymeleaf.png

879 KiB

import { ImagePool } from '@squoosh/lib'
import { cpus } from 'os'
import fs from 'fs/promises'
import { dirname, join, parse } from 'path'
import { fileURLToPath } from 'url'
const __dirname = dirname(fileURLToPath(import.meta.url))
const imagePool = new ImagePool(cpus().length)
const imagesDirectory = join(__dirname, 'img')
const distDirectory = join(__dirname, 'dist')
const imageNames = await fs.readdir(imagesDirectory)
for (let imageName of imageNames) {
if (imageName.endsWith('.png') || imageName.endsWith('.jpeg') || imageName.endsWith('.jpg')) {
console.log(`Processing ${imageName}...`)
const file = await fs.readFile(join(imagesDirectory, imageName))
const image = imagePool.ingestImage(file)
await image.preprocess({
quant: {
numColors: 256,
dither: 1
}
})
await image.encode({ oxipng: { level: 3 }, webp: { quality: 85 } })
const oxipngEncodedImage = await image.encodedWith.oxipng
await fs.writeFile(join(distDirectory, imageName), oxipngEncodedImage.binary)
const webpEncodedImage = await image.encodedWith.webp
await fs.writeFile(join(distDirectory, `${parse(imageName).name}.webp`), webpEncodedImage.binary)
}
}
await imagePool.close();