{"id":18718514,"url":"https://github.com/highlightjs/highlightjs-structured-text","last_synced_at":"2026-02-19T12:07:34.973Z","repository":{"id":45068887,"uuid":"200199270","full_name":"highlightjs/highlightjs-structured-text","owner":"highlightjs","description":"Highlightjs Structured Text language support IEC 61131-3","archived":false,"fork":false,"pushed_at":"2025-02-27T07:35:28.000Z","size":132,"stargazers_count":20,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-21T08:46:13.147Z","etag":null,"topics":["61131-3","highlight","highlight-js","highlightjs","plc","structured-text","syntax-highlighting"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/highlightjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-02T08:42:31.000Z","updated_at":"2024-09-09T05:11:55.000Z","dependencies_parsed_at":"2022-09-07T14:12:18.100Z","dependency_job_id":null,"html_url":"https://github.com/highlightjs/highlightjs-structured-text","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highlightjs%2Fhighlightjs-structured-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highlightjs%2Fhighlightjs-structured-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highlightjs%2Fhighlightjs-structured-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highlightjs%2Fhighlightjs-structured-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/highlightjs","download_url":"https://codeload.github.com/highlightjs/highlightjs-structured-text/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578393,"owners_count":21127712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["61131-3","highlight","highlight-js","highlightjs","plc","structured-text","syntax-highlighting"],"created_at":"2024-11-07T13:21:42.144Z","updated_at":"2026-02-19T12:07:34.967Z","avatar_url":"https://github.com/highlightjs.png","language":"JavaScript","readme":"# ST Language Support\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/highlightjs/highlightjs-structured-text.svg)](https://greenkeeper.io/)\n\nThis repository provides syntax highlighting for Highlight.js for Structured Text. ST is one of the 6 languages of IEC 61131-3 standard developed in 1998 for developing PLC programs.\n\nWe want to provide ST syntax highlights in VS Code Markdown editor and Markdown preview. And other cases when tutorials are published in the web.\n\n## Install\n\n    npm i highlightjs-structured-text --save\n\n## Usage\n\n### Browser\n\nInclude the `highlight.js` script package in your webpage or node app, load this module and register it with `hljs`. Follow instructions at [highlightjs](https://highlightjs.org/) to learn how to include the library and CSS.\n\nIf you're not using a build system and just want to embed this in your webpage:\n\n```html\n\u003cscript type=\"text/javascript\" src=\"/path/to/highlight.pack.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"/path/to/highlightjs-structured-text/dist/iecst.min.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\"\u003e\n    hljs.highlightAll();\n\u003c/script\u003e\n```\n\n### Nodejs\n\nIf you're using webpack / rollup / browserify / node:\n\n```javascript\nvar hljs = require('highlightjs');\nvar hljsDefineIECST = require('highlightjs-structured-text');\n\nhljs.registerLanguage('iecst', hljsDefineIECST);\nhljs.initHighlightingOnLoad();\n```\n\nMark the code you want to highlight with the iecst class:\n\n```html\n\u003cpre\u003e\u003ccode class=\"iecst\"\u003e...\u003c/code\u003e\u003c/pre\u003e\n```\n\n### Programmatically\n\nOr use JavaScript to programmatically highlight text string:\n\n```javascript\nhljs.registerLanguage('iecst', hljsDefineIECST);\nvar highlighted = hljs.highlightAuto(text_string, [\"iecst\"]);\n```\n\n### React\n\n```js\nimport React, {Component} from 'react'\nimport 'highlight.js/scss/darcula.scss' # your favourite theme\nimport cypher from './iecst'\nimport hljs from 'highlight.js'\nhljs.registerLanguage('iecst', iecst);\n\nclass Highlighter extends Component\n{\n  constructor(props)\n  {\n    super(props);\n    hljs.initHighlightingOnLoad();\n  }\n\n  render()\n  {\n    let {children} = this.props;\n    return\n    {\n      \u003cpre ref={(node) =\u003e this.node = node}\u003e\n        \u003ccode className=\"iecst\"\u003e\n          {children}\n        \u003c/code\u003e\n      \u003c/pre\u003e\n    }\n  }\n}\n\nexport default Highlighter;\n```\n\n### Marp\n\nTo use in [marp](https://marp.app)\n\nFirst create file `engine.js`\n\n```js\nconst { Marp } = require('@marp-team/marp-core')\nconst hljs = require('highlight.js')\nconst iecst = require('highlightjs-structured-text')\nhljs.registerLanguage(\"iecst\", iecst)\n\nmodule.exports = (opts) =\u003e {\n  const marp = new Marp(opts)\n\n  marp.highlighter = (code, lang) =\u003e {\n    if (lang) {\n      return hljs.getLanguage(lang)\n        ? hljs.highlight(lang, code, true).value\n        : ''\n    }\n    return hljs.highlightAuto(code).value\n  }\n\n  return marp\n}\n```\n\nAnd now when you build with CLI add engine parameter,\n\n```bash\nnpx marp --engine ./enjine.js ./slides.md\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhighlightjs%2Fhighlightjs-structured-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhighlightjs%2Fhighlightjs-structured-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhighlightjs%2Fhighlightjs-structured-text/lists"}