Skip to content

Commit

Permalink
More docs
Browse files Browse the repository at this point in the history
  • Loading branch information
breck7 committed Jan 8, 2025
1 parent f6bf7c9 commit 5654578
Show file tree
Hide file tree
Showing 18 changed files with 86 additions and 4 deletions.
1 change: 1 addition & 0 deletions leetsheet.scroll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
buildCsv
buildJson
title Scroll LeetSheet

header.scroll
Expand Down
2 changes: 2 additions & 0 deletions parsers/aftertext.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ aftertextColorParser
extends aftertextStyleParser
catchAllAtomType cssAnyAtom
string property color
example
color blue

aftertextOnclickParser
popularity 0.000217
Expand Down
6 changes: 6 additions & 0 deletions parsers/assertions.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ assertIgnoreBelowErrorsParser
assertHtmlEqualsParser
extends abstractAssertionParser
string kind equal
example
<b></b>
assertHtmlEquals <b></b>
javascript
areEqual(actual, expected) {
return actual === expected
Expand All @@ -44,6 +47,9 @@ assertHtmlEqualsParser
assertBuildIncludesParser
extends abstractAssertionParser
string kind include
example
buildCsv
assertBuildIncludes virginica
javascript
areEqual(actual, expected) {
return actual.includes(expected)
Expand Down
2 changes: 2 additions & 0 deletions parsers/container.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ scrollContainerParser
popularity 0.000096
cue container
description A centered HTML div.
example
container 600px
catchAllAtomType cssLengthAtom
extends abstractAftertextParser
boolean isHtml true
Expand Down
11 changes: 11 additions & 0 deletions parsers/css.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ buildCssParser
popularity 0.000048
description Compile to CSS file.
extends abstractBuildTwoCommandParser
example
buildCss

cssAnyAtom
extends codeAtom
Expand All @@ -15,6 +17,9 @@ cssParser
popularity 0.007211
extends abstractScrollParser
description A style tag.
example
css
body { color: red;}
cueFromId
catchAllParser cssLineParser
catchAllAtomType cssAnyAtom
Expand Down Expand Up @@ -47,6 +52,8 @@ scrollBackgroundColorParser
extends abstractScrollParser
cue background
catchAllAtomType cssAnyAtom
example
background red
javascript
buildHtml() {
return `<style>html, body { background: ${this.content};}</style>`
Expand All @@ -70,6 +77,8 @@ scrollFontParser
cue font
atoms cueAtom fontFamilyAtom
catchAllAtomType cssAnyAtom
example
font Slim
javascript
buildHtml() {
const font = this.content === "Slim" ? "Helvetica Neue; font-weight:100;" : this.content
Expand All @@ -80,6 +89,8 @@ quickCssParser
popularity 0.007524
description Make a CSS tag.
extends abstractQuickIncludeParser
example
style.css
atoms urlAtom
pattern ^[^\s]+\.(css)$
javascript
Expand Down
3 changes: 3 additions & 0 deletions parsers/date.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ printDateParser
// If not present computes the date from the file's ctime.
description Print published date.
boolean isPopular true
example
date 1/11/2019
printDate
javascript
buildHtml() {
return `<div class="printDateParser">${this.day}</div>`
Expand Down
2 changes: 2 additions & 0 deletions parsers/delimited.parsers
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
buildCsvParser
popularity 0.000096
example
buildCsv
description Compile to CSV file.
extends abstractBuildOneCommandParser

Expand Down
6 changes: 6 additions & 0 deletions parsers/dinkus.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ horizontalRuleParser
cue ---
description A horizontal rule.
extends abstractDinkusParser
example
---
javascript
buildHtml() {
return `<hr>`
Expand All @@ -28,6 +30,8 @@ scrollDinkusParser
cue ***
description A dinkus. Breaks section.
boolean isPopular true
example
***
extends abstractDinkusParser
javascript
dinkus = "*"
Expand All @@ -43,5 +47,7 @@ endOfPostDinkusParser
description End of post dinkus.
boolean isPopular true
cue ****
example
****
javascript
dinkus = "⁂"
10 changes: 10 additions & 0 deletions parsers/documentation.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ belowAsCodeParser
string bindTo next
extends abstractScrollParser
catchAllAtomType integerAtom
example
belowAsCode
iris
printTable
cueFromId
javascript
method = "next"
Expand Down Expand Up @@ -71,6 +75,9 @@ belowAsHtmlParser
extends belowAsCodeParser
description Displays html output of next particle in a code block.
cueFromId
example
belowAsHtml
# Hello world
javascript
get code() {
return this.selectedParticles.filter(p => p.buildHtml).map(p => p.buildHtml()).join("\n")
Expand All @@ -79,6 +86,9 @@ belowAsHtmlParser
aboveAsHtmlParser
description Displays html output of previous particle in a code block.
extends belowAsHtmlParser
example
# Hello world
aboveAsHtml
javascript
method = "previous"
reverse = true
10 changes: 10 additions & 0 deletions parsers/headers.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ h1Parser
popularity 0.017918
description An html h1 tag.
extends abstractHeaderParser
example
# Hello world
boolean isArticleContent true
cue #
boolean isPopular true
Expand All @@ -29,6 +31,8 @@ h2Parser
popularity 0.005257
description An html h2 tag.
extends abstractHeaderParser
example
## Hello world
boolean isArticleContent true
cue ##
boolean isPopular true
Expand All @@ -39,6 +43,8 @@ h3Parser
popularity 0.001085
description An html h3 tag.
extends abstractHeaderParser
example
### Hello world
boolean isArticleContent true
cue ###
javascript
Expand All @@ -47,6 +53,8 @@ h3Parser
h4Parser
popularity 0.000289
description An html h4 tag.
example
#### Hello world
extends abstractHeaderParser
cue ####
javascript
Expand All @@ -55,6 +63,8 @@ h4Parser
h5Parser
description An html h5 tag.
extends abstractHeaderParser
example
##### Hello world
cue #####
javascript
tag = "h5"
6 changes: 6 additions & 0 deletions parsers/html.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ quickIncludeHtmlParser
popularity 0.007524
description Include an HTML file.
extends abstractQuickIncludeParser
example
body.html
atoms urlAtom
pattern ^[^\s]+\.(html|htm)$
javascript
Expand All @@ -59,6 +61,8 @@ abstractHtmlParser
scrollBrParser
popularity 0.000096
cue br
example
br 2
description A break.
extends abstractScrollParser
catchAllAtomType integerAtom
Expand All @@ -84,6 +88,8 @@ htmlInlineParser
extends abstractHtmlParser
atoms htmlAnyAtom
boolean isHtml true
example
<h1>Inline HTML</h1>
pattern ^<
description Inline HTML.
boolean isPopular true
Expand Down
5 changes: 5 additions & 0 deletions parsers/images.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ captionAftertextParser
popularity 0.003207
description An image caption.
cue caption
example
map.png
caption A map.
extends scrollParagraphParser
boolean isPopular true

Expand Down Expand Up @@ -91,6 +94,8 @@ scrollImageParser
quickImageParser
popularity 0.005788
extends scrollImageParser
example
screenshot.png
atoms urlAtom
pattern ^[^\s]+\.(jpg|jpeg|png|gif|webp|svg|bmp)
int atomIndex 0
2 changes: 2 additions & 0 deletions parsers/javascript.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ quickScriptParser
description Make a Javascript tag.
extends abstractQuickIncludeParser
atoms urlAtom
example
script.js
pattern ^[^\s]+\.(js)$
javascript
buildHtml() {
Expand Down
14 changes: 11 additions & 3 deletions parsers/leetsheet.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,26 @@ printScrollLeetSheetParser
getNote() {
return ""
}
buildCsv() {
get docs() {
const rows = this.sortDocs(this.parsersToDocument).map(obj => {
const {id, isPopular, description, popularity, category} = obj
const {id, isPopular, description, popularity, category, examples, cue} = obj
const example = examples.length ? examples[0].subparticlesToString() : cue
return {
id,
isPopular,
description,
popularity,
example,
category
}
})
return new Particle(this.root.lodash.sortBy(rows, "isPopular")).asCsv
return this.root.lodash.sortBy(rows, "isPopular")
}
buildJson() {
return JSON.stringify(this.docs, undefined, 2)
}
buildCsv() {
return new Particle(this.docs).asCsv
}

printparsersLeetSheetParser
Expand Down
4 changes: 3 additions & 1 deletion parsers/music.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ quickSoundParser
extends scrollMusicParser
atoms urlAtom
pattern ^[^\s]+\.(mp3|wav|ogg|aac|m4a|flac)
int atomIndex 0
int atomIndex 0
example
sipOfCoffee.m4a
2 changes: 2 additions & 0 deletions parsers/permalinks.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ baseUrlParser
popularity 0.009188
description Required for RSS and OpenGraph.
extends abstractUrlSettingParser
example
baseUrl https://hub.scroll.pub/

permalinkParser
popularity 0.000265
Expand Down
2 changes: 2 additions & 0 deletions parsers/theme.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ scrollThemeParser
popularity 0.007524
boolean isPopular true
cue theme
example
theme gazette
extends abstractScrollParser
catchAllAtomType scrollThemeAtom
description A collection of simple themes.
Expand Down
2 changes: 2 additions & 0 deletions parsers/video.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ scrollVideoParser
quickVideoParser
popularity 0.000024
extends scrollVideoParser
example
spirit.mp4
atoms urlAtom
pattern ^[^\s]+\.(mp4|webm|avi|mov)
int atomIndex 0

0 comments on commit 5654578

Please sign in to comment.