Skip to content

Commit

Permalink
Added section and p parsers since AI keeps trying to use them
Browse files Browse the repository at this point in the history
  • Loading branch information
breck7 committed Jan 9, 2025
1 parent 5654578 commit a6548c0
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scroll-cli",
"version": "165.2.0",
"version": "165.3.0",
"description": "A language for scientists of all ages. A curated collection of tools for refining and sharing thoughts.",
"main": "scroll.js",
"engines": {
Expand Down
5 changes: 4 additions & 1 deletion parsers/aftertext.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ abstractAftertextParser
if (tag === "none") // Allow no tag for aftertext in tables
return this.text
const id = this.has("id") ? "" : `id="${this.htmlId}" ` // always add an html id
return this.getHtmlRequirements(buildSettings) + `<${tag} ${id}${this.htmlAttributes}${classAttr}${styles}>${this.text}${this.closingTag}`
return this.getHtmlRequirements(buildSettings) + `<${tag} ${id}${this.htmlAttributes}${classAttr}${styles}>${this.htmlContents}${this.closingTag}`
}
get htmlContents() {
return this.text
}
get closingTag() {
const tag = this.get("tag") || this.tag
Expand Down
16 changes: 11 additions & 5 deletions parsers/paragraphs.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,24 @@ quickParagraphParser
example
* I had a _new_ idea.

pParagraphParser
popularity 0.001881
cue p
extends scrollParagraphParser
description A paragraph.
boolean isArticleContent true
example
p I had a _new_ idea.

abstractIndentableParagraphParser
extends scrollParagraphParser
inScope abstractAftertextDirectiveParser abstractAftertextAttributeParser abstractIndentableParagraphParser
javascript
compileSubparticles() {
return this.map(particle => particle.buildHtml())
get htmlContents() {
return this.text + this.map(particle => particle.buildHtml())
.join("\n")
.trim()
}
buildHtml() {
return super.buildHtml() + this.compileSubparticles()
}
buildTxt() {
return this.getAtom(0) + " " + super.buildTxt()
}
2 changes: 1 addition & 1 deletion parsers/root.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ scrollParser
}
get scrollVersion() {
// currently manually updated
return "165.2.0"
return "165.3.0"
}
// Use the first paragraph for the description
// todo: add a particle method version of get that gets you the first particle. (actulaly make get return array?)
Expand Down
14 changes: 14 additions & 0 deletions parsers/sections.parsers
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
scrollSectionParser
popularity 0.007524
description HTML section tag.
extends abstractIndentableParagraphParser
inScope abstractAftertextDirectiveParser abstractAftertextAttributeParser abstractIndentableParagraphParser scrollParagraphParser
cue section
example
section
# Hello world
p This is a test
section
# Deeper
javascript
tag = "section"
4 changes: 4 additions & 0 deletions releaseNotes.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ ciBadges.scroll
br
thinColumns

📦 165.3.0 1/09/2025
🎉 added sectionParser
🎉 added pParser

📦 165.2.0 1/08/2025
🎉 added `keywords` parser because AI keeps trying to use it.
🏥 slideshow fixes
Expand Down

0 comments on commit a6548c0

Please sign in to comment.