Code Monkey home page Code Monkey logo

tag-list's Introduction

tag-list

This is the tag documentation generator for the English-speaking branch of the SCP Wiki.

The documentation generator implements (and is a proof-of-concept of) a prospective interface for defining tags that may in the future be used by Wikijump. Tags are defined as TOML in order to be easily machine-readable, and the documentation is designed to be as human-readable as reasonably possible.

You can see the tag documentation generator and the tag documentation itself in action on 05command, the SCP Wiki's staff site.

This project will be deprecated with the fruition of Wikijump, which will contain native solutions for the problems this tool addresses.

Usage

While the tool is designed to be as versatile as possible, please note that it is currently only available in English.

Installation

On Wikidot:

[[html]]
<script
  id="script"
  src="https://scpwiki.github.io/tag-list/tag-list.js?categoryCount=X&site=Y&page=Z"
></script>
[[/html]]

Replace X with the number of tag categories, Y with the URL of the wiki with the page containing the tag list manifest, and Z with the slug (a.k.a. "fullname" or "UNIX name") of that page. These parameters will be used to autofill the input boxes in the tool, enabling most usage to be as simple as clicking two buttons.

The tool does not need to be on the same page as the tag manifest.

Defining the template

The tool expects that the first code block on the page will contain the documentation template, written as Wikitext with Embedded JavaScript. See our implementation on 05command for an example.

Defining the manifest

The tool expects that all remaining code blocks on the page will contain TOML files for tag categories.

See instructions for setting up each tag category.

When inserting the TOML into a code block, note that Wikidot does not support TOML syntax highlighting โ€” we recommend using [[code type="python"]], which seems to be close enough.

Using the tool

The tool has an input for the URL of the documentation template, and a textarea for the URLs of each category of the tag manifest. With proper query parameter setup, these fields should be filled correctly automatically, but they can be adjusted as needed. There is a button that will fetch these resources from their URLs.

The tool also supports pasting the template or manifest directly.

The tool will output the documentation template with all tags from the manifest inserted. Any errors should be reported immediately, although you may need to check the console for more details.

Development

Install dependencies using npm:

$ npm install

Once this is done, the following scripts are provided as part of the local development process:

$ npm run start  # Live view local version in your browser
$ npm run lint   # Run linter
$ npm run fix    # Run linter in fix mode
$ npm run tests  # Run test suite
$ npm run build  # Create production build

Reporting issues

If there are any issues with this tool, please contact the SCP Wiki Tech Team.

tag-list's People

Contributors

emmiegit avatar rossjrw avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

hoah2333

tag-list's Issues

Get defaults from URL query

Default constants for the tool are currently hardcoded:

tag-list/src/index.ts

Lines 39 to 41 in 00ed447

const numberOfTagFiles = 14
const site = "http://05command.wikidot.com"
const page = "tag-list-manifest"

This was never a permanent solution, which requires changing the base code in order to change these defaults (e.g. I had to decrease the constant from 15 to 14 when merging two tag categories on EN). It's not strictly necessary to change them, because all values can be adjusted in the UI at runtime, but it is inconvenient.

Getting these constants from the URL of the iframe seems like the ideal solution - the constants for a given site's tags could then be changed from the page containing the documentation generator. It would also allow other sites e.g. international branches other than EN) to use the tag documentation generator without needing to fork it (although the copy would still be in English).

Multiple conflict conditions

Right now it's only possible to specify a single conflict condition, even if that condition is vague enough to cover all use cases. Multiple conflict conditions may be required.

For example, a tag may need to conflict with a page that is tagged both t1 and t2, and with a page that is tagged t3 and t4, but other combinations are fine.

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.