diff --git a/.hlint.yaml b/.hlint.yaml deleted file mode 100644 index df9b14e18..000000000 --- a/.hlint.yaml +++ /dev/null @@ -1,89 +0,0 @@ -# Based on HLint configuration file from https://github.com/ndmitchell/hlint - -- arguments: [--color] - -# ------------------------------------------------------------------------------ -# RESTRICTIONS -# ------------------------------------------------------------------------------ - -- extensions: - - default: false - - name: - - ApplicativeDo - - DataKinds - - DerivingStrategies - - GADTs - - ImportQualifiedPost - - LambdaCase - - NoImplicitPrelude - - OverloadedStrings - - QuantifiedConstraints - - QuasiQuotes - - RecordWildCards - - StandaloneKindSignatures - - TemplateHaskell - - TypeFamilyDependencies - - UndecidableInstances - - UnicodeSyntax - - GeneralizedNewtypeDeriving - -- flags: - - default: false - - name: - - -Wall - - -Wcompat - - -Wderiving-defaults - - -Widentities - - -Wincomplete-patterns - - -Wincomplete-record-updates - - -Wincomplete-uni-patterns - - -Wmissing-deriving-strategies - - -Wredundant-constraints - - -O2 -flate-specialise -fspecialise-aggressively - -- modules: - # if you import Data.Set qualified, it must be as 'Set' - - { name: [Data.Set, Data.HashSet], as: Set } - - { name: [Data.Map, Data.HashMap.Strict, Data.HashMap.Lazy], as: Map } - # - {name: Control.Arrow, within: []} # Certain modules are banned entirely - -- functions: - - { name: Data.List.NonEmpty.nub, within: [] } - - { name: Data.List.NonEmpty.nubBy, within: [] } - -# ------------------------------------------------------------------------------ -# OTHER HINTS -# ------------------------------------------------------------------------------ - -# - warn: {name: Use explicit module export list} - -# ------------------------------------------------------------------------------ -# HINTS -# ------------------------------------------------------------------------------ - -- error: { lhs: idea Warning, rhs: warn } -- error: { lhs: idea Suggestion, rhs: suggest } -- error: { lhs: ideaN Warning, rhs: warnN } -- error: { lhs: ideaN Suggestion, rhs: suggestN } - -- error: { lhs: occNameString (occName (unLoc x)), rhs: rdrNameStr x } -- error: { lhs: occNameString (occName x), rhs: occNameStr x } -- error: - { - lhs: noLoc (HsVar noExtField (noLoc (mkRdrUnqual (mkVarOcc x)))), - rhs: strToVar x, - } - -# ------------------------------------------------------------------------------ -# IGNORES -# ------------------------------------------------------------------------------ - -- ignore: { name: Use let, within: [Test.All] } -- ignore: { name: Use String } -- ignore: { name: Avoid restricted qualification } -- ignore: { name: Redundant multi-way if } -- ignore: { name: Redundant bracket } -- ignore: { name: Eta reduce } -- ignore: { name: Avoid restricted alias } -- ignore: { name: Use tuple-section } -- ignore: { name: Use map with tuple-section } diff --git a/Makefile b/Makefile index c80ba8294..040b74f68 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,6 @@ all: build clean: clean-runtime @${STACK} clean --full @rm -rf .hie - @rm -rf book .PHONY: clean-hard clean-hard: clean @@ -158,16 +157,6 @@ check-ormolu: export ORMOLUMODE = check check-ormolu: @${MAKE} ormolu -HLINT?=stack exec -- hlint -HLINTFLAGS?= -HLINTQUIET := - -.PHONY : hlint -hlint : - ${HLINT} ${HLINTFLAGS} app ${HLINTQUIET} - ${HLINT} ${HLINTFLAGS} src ${HLINTQUIET} - ${HLINT} ${HLINTFLAGS} test ${HLINTQUIET} - PRECOMMIT := $(shell command -v pre-commit 2> /dev/null) .PHONY : install-pre-commit diff --git a/assets/images/tara-magicien.png b/assets/images/tara-magicien.png deleted file mode 100644 index 9547cd3aa..000000000 Binary files a/assets/images/tara-magicien.png and /dev/null differ diff --git a/assets/images/tara-seating.svg b/assets/images/tara-seating.svg deleted file mode 100644 index 14d49623f..000000000 --- a/assets/images/tara-seating.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/tara-smiling.png b/assets/images/tara-smiling.png deleted file mode 100644 index a37360a1d..000000000 Binary files a/assets/images/tara-smiling.png and /dev/null differ diff --git a/assets/images/tara-teaching.png b/assets/images/tara-teaching.png deleted file mode 100644 index 0a14b307c..000000000 Binary files a/assets/images/tara-teaching.png and /dev/null differ diff --git a/assets/images/tara-teaching.svg b/assets/images/tara-teaching.svg deleted file mode 100644 index 98ca5d366..000000000 --- a/assets/images/tara-teaching.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/book.toml b/book.toml deleted file mode 100644 index 2317722f2..000000000 --- a/book.toml +++ /dev/null @@ -1,60 +0,0 @@ -[book] -title = "The Juvix Book" -authors = [ "Jonathan Prieto-Cubides" , "Jan Mas Rovira" , "Paul Cadman" , "Lukasz Czajka" ] -language = "en" -multilingual = false -src = "docs" - -[build] -create-missing = true - -[preprocessor.index] - -[preprocessor.links] - -[preprocessor.pagetoc] - -[preprocessor.katex] -renderers = ["html"] -static-css = false -include-src = false -block-delimiter = {left = "$$", right = "$$"} -inline-delimiter = {left = "$", right = "$"} -macros = "theme/latex-macros.txt" - -[output.katex] - -[output.html] -default-theme = "light" -preferred-dark-theme = "Ayu" -copy-fonts = true -additional-css = ["theme/pagetoc.css", "theme/juvix.css"] -additional-js = ["theme/pagetoc.js", "theme/juvix.js", "theme/pascal.js"] -no-section-label = false -git-repository-url = "https://github.com/anoma/juvix" -git-repository-icon = "fa-github" - -[output.html.fold] -enable = true # whether or not to enable section folding -level = 0 # the depth to start folding - -[output.html.search] -enable = true # enables the search feature -limit-results = 15 # maximum number of search results -teaser-word-count = 30 # number of words used for a search result teaser -use-boolean-and = true # multiple search terms must all match -boost-title = 2 # ranking boost factor for matches in headers -boost-hierarchy = 1 # ranking boost factor for matches in page names -boost-paragraph = 1 # ranking boost factor for matches in text -expand = true # partial words will match longer terms -heading-split-level = 2 # link results to heading levels -copy-js = true # include Javascript code for search - -[output.linkcheck] -follow-web-links = false -traverse-parent-directories = false -exclude = [ ] -user-agent = "mdbook-linkcheck-0.4.0" -cache-timeout = 43200 -[output.linkcheck.http-headers] -'crates\.io' = ["Accept: text/html"] diff --git a/licenses/agda/LICENSE b/licenses/agda/LICENSE deleted file mode 100644 index af3fef33e..000000000 --- a/licenses/agda/LICENSE +++ /dev/null @@ -1,101 +0,0 @@ -Copyright (c) 2005-2021 remains with the authors. -Agda 2 was originally written by Ulf Norell, -partially based on code from Agda 1 by Catarina Coquand and Makoto Takeyama, -and from Agdalight by Ulf Norell and Andreas Abel. - -Agda 2 is currently actively developed mainly by Andreas Abel, -Guillaume Allais, Liang-Ting Chen, Jesper Cockx, Matthew Daggitt, Nils -Anders Danielsson, Ulf Norell, Andrés Sicard-Ramírez, and Andrea -Vezzosi. - -Further, Agda 2 has received contributions by, amongst others, Stevan -Andjelkovic, Marcin Benke, Jean-Philippe Bernardy, Guillaume Brunerie, -James Chapman, Dominique Devriese, Péter Diviánszky, Robert Estelle, -Olle Fredriksson, Adam Gundry, Daniel Gustafsson, Philipp Hausmann, -Alan Jeffrey, Wolfram Kahl, Wen Kokke, John Leo, Fredrik Lindblad, -Víctor López Juan, Ting-Gan Lua, Francesco Mazzoli, Stefan Monnier, -Guilhem Moulin, Fredrik Nordvall Forsberg, Nicolas Pouillard, Jonathan -Prieto, Christian Sattler, Makoto Takeyama, Noam Zeilberger, and Tesla -Ice Zhang. The full list of contributors is available at -https://github.com/agda/agda/graphs/contributors or from the git -repository via ``git shortlog -sne``. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - -The file src/full/Agda/Utils/Maybe/Strict.hs (and the following -license text?) uses the following license: - -Copyright (c) Roman Leshchinskiy 2006-2007 - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the author nor the names of his contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - ------------------------------------------------------------------------- - -The file src/data/html/highlight-hover.js (and the following licence -text?) seems to use the following licence: - -Copyright 2002-2010, Simon Marlow. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/licenses/agda/readme.org b/licenses/agda/readme.org deleted file mode 100644 index a55a2abe9..000000000 --- a/licenses/agda/readme.org +++ /dev/null @@ -1,3 +0,0 @@ -#+title: Readme - -We have copied [[https://github.com/agda/agda][Agda]]'s input method and adapted it to Juvix. diff --git a/theme/index.hbs b/theme/index.hbs deleted file mode 100644 index 89e1e09fc..000000000 --- a/theme/index.hbs +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - {{ title }} - {{#if is_print }} - - {{/if}} - {{#if base_url}} - - {{/if}} - - - - {{> head}} - - - - - - {{#if favicon_svg}} - - {{/if}} - {{#if favicon_png}} - - {{/if}} - - - - {{#if print_enable}} - - {{/if}} - - - - {{#if copy_fonts}} - - {{/if}} - - - - - - - - {{#each additional_css}} - - {{/each}} - - {{#if mathjax_support}} - - - {{/if}} - - -
- - - - - - - - - - - - - - -
- -
- {{> header}} - - - - {{#if search_enabled}} - - {{/if}} - - - - -
-
- {{{ content }}} -
- - -
-
- - - -
- - {{#if live_reload_endpoint}} - - - {{/if}} - - {{#if google_analytics}} - - - {{/if}} - - {{#if playground_line_numbers}} - - {{/if}} - - {{#if playground_copyable}} - - {{/if}} - - {{#if playground_js}} - - - - - - {{/if}} - - {{#if search_js}} - - - - {{/if}} - - - - - - - - - - - {{#each additional_js}} - - {{/each}} - - {{#if is_print}} - {{#if mathjax_support}} - - {{else}} - - {{/if}} - {{/if}} - -
- - diff --git a/theme/juvix.css b/theme/juvix.css deleted file mode 100644 index 844136e90..000000000 --- a/theme/juvix.css +++ /dev/null @@ -1,27 +0,0 @@ -.hljs-meta { - color: coral; -} - -.hljs-inductive { - color: #86b300; -} - -.hljs-number { - color: #00a822; -} - -.hljs-function { - color: #d78810; -} - -.hljs-symbol { - color: #d78810; -} - -.hljs-string { - color: #f07171; -} - -.hljs-keyword { - color: #399ee6; -} diff --git a/theme/juvix.js b/theme/juvix.js deleted file mode 100644 index c330e5230..000000000 --- a/theme/juvix.js +++ /dev/null @@ -1,338 +0,0 @@ -/* -The following is specifically tailored for compatibility with HighlightJS -10.1.1, which is used in MdBook. Support for the latest version of HighlightJS, -v11.7, can be found at the following repository: -https://github.com/anoma/highlightjs-juvix -*/ - -var module = module ? module : {}; // shim for browser use - -const MATCH_NOTHING_RE = /$^/; // to force a mode to never match - -const INLINE_COMMENT = { - className: "comment", - begin: /--/, - end: /$/, -}; - -const BLOCK_COMMENT = { - className: "comment", - begin: /\{-/, - end: /-\}/, - relevance: 1, -}; - -const COMMENT = { - scope: "comment", - contains: ["self"], - variants: [INLINE_COMMENT, BLOCK_COMMENT], -}; - -const STRINGS = { - className: "string", - variants: [hljs.QUOTE_STRING_MODE], -}; - -const NUMBERS = hljs.C_NUMBER_MODE; - -const RESERVED_SYMBOLS = { - className: "keyword", - begin: - /(@|:=|->|→|↦|;|\||\{|\}|\\|λ|\s:\s|\_|Type|\slet\s|\sin\s|terminating|positive|axiom|builtin|open|end)/, - endsSameBegin: true, -}; - -const OTHER_SYMBOLS_AND_OPERATORS = [ - { - className: "operator", - begin: /(\*|\|\||&&|==|>>|=?>|<=?|-\s|\+)/, - endsSameBegin: true, - }, - { className: "punctuation", begin: /(\(|\))/, endsSameBegin: true }, - { begin: /::/, endsSameBegin: true }, - // an issue of this hljs version is that some keywords are not highlighted - // even though they are in the keywords list. This is a workaround - { className: "literal", begin: /(true|false)/, endsSameBegin: true }, - { className: "built_in", begin: /(trace|IO|if|case)/, endsSameBegin: true }, -]; - -const MODULE_NAME_RE = /[a-zA-Z][a-zA-Z0-9_]*(\.[a-zA-Z][a-zA-Z0-9_]*)*/; -const IDEN_RE = /[^(\s|;|\{|\}|\(|\)|@)]+/; -//some symbols may brake the use of this - -function hljsDefineJuvix(hljs) { - const JUVIX_KEYWORDS = { - keyword: "let in print terminating positive axiom builtin open end", - built_in: "trace IO if case", - literal: "true false", - }; - - const MODULE_BEGIN = { - className: "keyword", - begin: /module/, - end: /;/, - contains: [ - BLOCK_COMMENT, - { - className: "title", - begin: MODULE_NAME_RE, - endsParent: true, - contains: [BLOCK_COMMENT], - }, - ], - }; - - const PUBLIC = { - className: "keyword", - begin: /public/, - end: /;/, - endsParent: true, - contains: [COMMENT], - }; - - const MODULE_END = { - className: "keyword", - begin: /end/, - end: /;/, - contains: [COMMENT], - }; - - const INFIX = { - className: "keyword", - begin: /((infix(l|r)?)|postfix)/, - end: MATCH_NOTHING_RE, - contains: [ - COMMENT, - { - className: "number", - begin: /\d+/, - end: MATCH_NOTHING_RE, - endsParent: true, - contains: [ - COMMENT, - { - className: "operator", - begin: IDEN_RE, - end: MATCH_NOTHING_RE, - endsParent: true, - contains: [ - COMMENT, - { - className: "keyword", - begin: /;/, - endsSameBegin: true, - endsParent: true, - }, - ], - }, - ], - }, - ], - }; - - const IMPORT = { - className: "keyword", - begin: /(((open )?import)|(open( import)?))/, - end: MATCH_NOTHING_RE, - // endsParent: true, - contains: [ - COMMENT, - { - className: "title", - begin: MODULE_NAME_RE, - end: MATCH_NOTHING_RE, - endsParent: true, - contains: [ - COMMENT, - PUBLIC, - { - className: "keyword", - begin: /;/, - endsParent: true, - }, - { - className: "keyword", - begin: /(hiding|using)/, - end: MATCH_NOTHING_RE, - contains: [ - COMMENT, - { - className: "keyword", - begin: /\{/, - end: /\}/, - endsParent: true, - contains: [ - COMMENT, - { - className: "symbol", - begin: IDEN_RE, - contains: [COMMENT, PUBLIC], - }, - ], - }, - ], - }, - ], - }, - ], - }; - - const INDUCTIVE = { - className: "inductive", - begin: /type/, - end: MATCH_NOTHING_RE, - keywords: "type", - contains: [ - COMMENT, - { - className: "keyword", - begin: /;/, - endsParent: true, - }, - { - // className: "symbol", - begin: IDEN_RE, - end: MATCH_NOTHING_RE, - endsParent: true, - contains: [ - COMMENT, - RESERVED_SYMBOLS, - { - // ( A : Type ) - begin: /\(/, - end: /\)/, - contains: [ - COMMENT, - { - // className: "symbol", - begin: IDEN_RE, - end: MATCH_NOTHING_RE, - endsParent: true, - contains: [ - COMMENT, - { - // type annotation - className: "keyword", - begin: /:/, - end: /Type/, - endsParent: true, - }, - ], - }, - ], - }, - ], - }, - ], - }; - - var OPTS = [ - COMMENT, - RESERVED_SYMBOLS, - MODULE_BEGIN, - MODULE_END, - IMPORT, - INFIX, - INDUCTIVE, - NUMBERS, - STRINGS, - ]; - - return { - name: "Juvix", - aliases: ["juvix"], - keywords: JUVIX_KEYWORDS, - contains: OPTS.concat({ - begin: /(?=[^(\s|;|\{|\}|\(|\)|@)]+\s*:)/, - end: MATCH_NOTHING_RE, - endsSameBegin: true, - contains: [ - { - className: "function", - begin: /^\s*[^(\s|;|\{|\}|\(|\)|@)]+(?=\s*:\s+.*;)/, - end: MATCH_NOTHING_RE, - contains: [ - COMMENT, - { - className: "keyword", - begin: /:\s+/, - endsSameBegin: true, - endsParent: true, - }, - { - className: "keyword", - begin: /;/, - endsSameBegin: true, - endsParent: true, - }, - ], - }, - { - className: "keyword", - begin: /;/, - endsSameBegin: true, - endsParent: true, - }, - ] - .concat(OPTS) - .concat([OTHER_SYMBOLS_AND_OPERATORS]), - }), - }; -} - -function hljsDefineJuvixRepl(hljs) { - return { - name: "Juvix REPL", - aliases: ["jrepl"], - case_insensitive: false, - unicodeRegex: true, - contains: [ - { - className: "meta", - begin: /^(Juvix REPL|OK)/, - end: /$/, - }, - { - begin: /^(?=([a-zA-Z][a-zA-Z0-9_]*(\.[a-zA-Z][a-zA-Z0-9_]*))?>)/, - end: /$/, - contains: [ - { - className: "meta", - begin: /([a-zA-Z][a-zA-Z0-9_]*(\.[a-zA-Z][a-zA-Z0-9_]*))?>\s+/, - endsSameBegin: true, - }, - { - className: "keyword", - begin: /:[a-z]+/, - endsWithParent: true, - contains: [ - { - subLanguage: "juvix", - endsWithParent: true, - }, - ], - }, - { - subLanguage: "juvix", - endsWithParent: true, - }, - ], - }, - { - begin: /^/, - end: /$/, - contains: [ - { - subLanguage: "juvix", - endsWithParent: true, - }, - ], - }, - ], - }; -} - -module.exports = function (hljs) { - hljs.registerLanguage("juvix", hljsDefineJuvix); - hljs.registerLanguage("jrepl", hljsDefineJuvixRepl); -}; diff --git a/theme/latex-macros.txt b/theme/latex-macros.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/theme/pagetoc.css b/theme/pagetoc.css deleted file mode 100644 index 98968f503..000000000 --- a/theme/pagetoc.css +++ /dev/null @@ -1,57 +0,0 @@ -@media only screen and (max-width: 1439px) { - .sidetoc { - display: none; - } -} - -@media only screen and (min-width: 1440px) { - main { - position: relative; - } - .sidetoc { - margin-left: auto; - margin-right: auto; - left: calc(100% + (var(--content-max-width)) / 4 - 140px); - position: absolute; - } - .pagetoc { - position: fixed; - width: 200px; - height: calc(100vh - var(--menu-bar-height) - 0.67em * 4); - overflow: auto; - } - .pagetoc a { - border-left: 1px solid var(--sidebar-bg); - color: var(--fg) !important; - display: block; - padding-bottom: 5px; - padding-top: 5px; - padding-left: 10px; - text-align: left; - text-decoration: none; - } - .pagetoc a:hover, - .pagetoc a.active { - background: var(--sidebar-bg); - color: var(--sidebar-fg) !important; - } - .pagetoc .active { - background: var(--sidebar-bg); - color: var(--sidebar-fg); - } - .pagetoc .pagetoc-H2 { - padding-left: 20px; - } - .pagetoc .pagetoc-H3 { - padding-left: 40px; - } - .pagetoc .pagetoc-H4 { - padding-left: 60px; - } - .pagetoc .pagetoc-H5 { - display: none; - } - .pagetoc .pagetoc-H6 { - display: none; - } -} diff --git a/theme/pagetoc.js b/theme/pagetoc.js deleted file mode 100644 index 4f4544998..000000000 --- a/theme/pagetoc.js +++ /dev/null @@ -1,58 +0,0 @@ -// Un-active everything when you click it -Array.prototype.forEach.call( - document.getElementsByClassName("pagetoc")[0].children, - function (el) { - el.addEventHandler("click", function () { - Array.prototype.forEach.call( - document.getElementsByClassName("pagetoc")[0].children, - function (el) { - el.classList.remove("active"); - }, - ); - el.classList.add("active"); - }); - }, -); - -var updateFunction = function () { - var id; - var elements = document.getElementsByClassName("header"); - Array.prototype.forEach.call(elements, function (el) { - if (window.pageYOffset >= el.offsetTop) { - id = el; - } - }); - - Array.prototype.forEach.call( - document.getElementsByClassName("pagetoc")[0].children, - function (el) { - el.classList.remove("active"); - }, - ); - if (!id) return; - Array.prototype.forEach.call( - document.getElementsByClassName("pagetoc")[0].children, - function (el) { - if (id.href.localeCompare(el.href) == 0) { - el.classList.add("active"); - } - }, - ); -}; - -// Populate sidebar on load -window.addEventListener("load", function () { - var pagetoc = document.getElementsByClassName("pagetoc")[0]; - var elements = document.getElementsByClassName("header"); - Array.prototype.forEach.call(elements, function (el) { - var link = document.createElement("a"); - link.appendChild(document.createTextNode(el.text)); - link.href = el.href; - link.classList.add("pagetoc-" + el.parentElement.tagName); - pagetoc.appendChild(link); - }); - updateFunction.call(); -}); - -// Handle active elements on scroll -window.addEventListener("scroll", updateFunction); diff --git a/theme/pascal.js b/theme/pascal.js deleted file mode 100644 index cf7b1dcd6..000000000 --- a/theme/pascal.js +++ /dev/null @@ -1,83 +0,0 @@ -// To be used with highlight.js v10.1.1 -function hljsDefinePascal(e) { - var a = - "exports register file shl array record property for mod while set ally label uses raise not stored class safecall var interface or private static exit index inherited to else stdcall override shr asm far resourcestring finalization packed virtual out and protected library do xorwrite goto near function end div overload object unit begin string on inline repeat until destructor write message program with read initialization except default nil if case cdecl in downto threadvar of try pascal const external constructor type public then implementation finally published procedure absolute reintroduce operator as is abstract alias assembler bitpacked break continue cppdecl cvar enumerator experimental platform deprecated unimplemented dynamic export far16 forward generic helper implements interrupt iochecks local name nodefault noreturn nostackframe oldfpccall otherwise saveregisters softfloat specialize strict unaligned varargs ", - r = [ - e.C_LINE_COMMENT_MODE, - e.COMMENT(/\{/, /\}/, { relevance: 0 }), - e.COMMENT(/\(\*/, /\*\)/, { relevance: 10 }), - ], - n = { - className: "meta", - variants: [ - { begin: /\{\$/, end: /\}/ }, - { begin: /\(\*\$/, end: /\*\)/ }, - ], - }, - t = { - className: "string", - begin: /'/, - end: /'/, - contains: [{ begin: /''/ }], - }, - s = { className: "string", begin: /(#\d+)+/ }, - i = { - begin: e.IDENT_RE + "\\s*=\\s*class\\s*\\(", - returnBegin: !0, - contains: [e.TITLE_MODE], - }, - c = { - className: "function", - beginKeywords: "function constructor destructor procedure", - end: /[:;]/, - keywords: "function constructor|10 destructor|10 procedure|10", - contains: [ - e.TITLE_MODE, - { - className: "params", - begin: /\(/, - end: /\)/, - keywords: a, - contains: [t, s, n].concat(r), - }, - n, - ].concat(r), - }; - return { - name: "Delphi", - aliases: [ - "dpr", - "dfm", - "pas", - "pascal", - "freepascal", - "lazarus", - "lpr", - "lfm", - ], - case_insensitive: !0, - keywords: a, - illegal: /"|\$[G-Zg-z]|\/\*|<\/|\|/, - contains: [ - t, - s, - e.NUMBER_MODE, - { - className: "number", - relevance: 0, - variants: [ - { begin: "\\$[0-9A-Fa-f]+" }, - { begin: "&[0-7]+" }, - { begin: "%[01]+" }, - ], - }, - i, - c, - n, - ].concat(r), - }; -} - -module.exports = function (hljs) { - hljs.registerLanguage("pascal", hljsDefinePascal); -};