Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

wikity

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wikity

Compile wikitext files into HTML, with built-in Eleventy support.


Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Wikity

Wikity is a tool that allows you to use Wikitext (used by Wikipedia, Fandom, etc) to create pages, for use in build tools such as Eleventy.

Install

Wikity is available on npm.

Local installGlobal install
npm install wikitynpm install -g wikity

API

  • wikity.compile(directory?: string, options?: object)
    • Compile Wikitext files into HTML. Find outputted files in folder wikity-out/.
    • directory?: string
      • The folder to compile (default: ., the current directory).
    • options?: object
      • eleventy?: boolean
        • Whether front matter will be added to the outputted HTML for Eleventy to read (default: false).
      • defaultStyles?: boolean
        • Whether to use default wiki styling (default: true).
      • customStyles?: string
        • Custom CSS to style the wiki pages (default: '').

Calling wikity() will compile all .wiki files into their corresponding .html versions. Outputted files are located in the wikity-out/ directory.

const wikity = require('wikity');
wikity.compile(); // compile all .wiki files inside this directory

Use Wikity along with Eleventy to compile your wiki files during the build process:

// .eleventy.js (eleventy's configuration file)
const wikity = require('wikity');
wikity.compile('.', { eleventy: true });

Usage

Use Wikitext to create your pages.

Any wiki templates (called using {{template name}}) must be inside the templates/ folder.

Wiki markup

MarkupPreview
'''bold'''bold
''italic''italic
'''''bold italic'''''bold italic
``code``code
```code block```
code block
= heading =

heading

== subheading ==

subheading

*bulleted
  • bulleted
**sub-bulleted
    • sub-bulleted
#numbered
  1. numbered
##sub-numbered
    1. sub-numbered
;term
term
:definition
 definition
[[internal link]]internal link
[[link|display text]]display text
[external-link][1]
[external-link display text]display text
{{name}}(contents of templates/name.wiki)
{{name|arg=val}}(ditto but {{{arg}}} is set to 'val')
{{{arg}}}(value given by template)
{{{arg|default val}}}(ditto but with default val if unset)
{{#if:non-empty-string|text}}text
{{#ifeq:1|2|true|false}}false
{{#vardefine:varname|text}}(saved to memory)
{{#var:varname}}text (from memory)
{{#var:varname|default val}}(ditto but with default val if unset)
<ref>Text</ref>[1]
{{reflist}}1. Text

Keywords

FAQs

Package last updated on 27 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc