diff --git a/blog/counterpoints.scroll b/blog/counterpoints.scroll index a5d10a16e..9f20ad128 100644 --- a/blog/counterpoints.scroll +++ b/blog/counterpoints.scroll @@ -1,10 +1,11 @@ +author https://github.com/breck7 Breck Yunits date 4/13/2023 groups All title Counterpoints: A new tool for thought in the Scroll Language import header.scroll printTitle -byLine https://github.com/breck7 Breck Yunits +printAuthor keyboardNav copyButtons diff --git a/blog/indented-heredocs.scroll b/blog/indented-heredocs.scroll index a6bfaa3b9..9a529c962 100644 --- a/blog/indented-heredocs.scroll +++ b/blog/indented-heredocs.scroll @@ -1,3 +1,4 @@ +author https://github.com/breck7 Breck Yunits date 2021.08.23 groups All replace GrammarLinked Grammar @@ -10,8 +11,7 @@ import header.scroll mediumColumns 1 printTitle - -byLine https://github.com/breck7 Breck Yunits +printAuthor keyboardNav diff --git a/blog/introducingBlink.scroll b/blog/introducingBlink.scroll index 4c5142d48..5aae2ae5e 100644 --- a/blog/introducingBlink.scroll +++ b/blog/introducingBlink.scroll @@ -1,10 +1,11 @@ +author https://github.com/breck7 Breck Yunits date 2022.10.02 groups All title Introducing the Blink Tag import header.scroll printTitle -byLine https://github.com/breck7 Breck Yunits +printAuthor printDate mediumColumns 1 diff --git a/blog/programLinks.scroll b/blog/programLinks.scroll index 63819e057..b897f3f57 100644 --- a/blog/programLinks.scroll +++ b/blog/programLinks.scroll @@ -1,10 +1,11 @@ +author https://github.com/breck7 Breck Yunits date 5/08/2023 groups All title Introducing Program Links import header.scroll printTitle -byLine https://github.com/breck7 Breck Yunits +printAuthor keyboardNav copyButtons diff --git a/blog/scrollsets.scroll b/blog/scrollsets.scroll index 14ec9369e..ba1c4582a 100644 --- a/blog/scrollsets.scroll +++ b/blog/scrollsets.scroll @@ -1,3 +1,4 @@ +author https://breckyunits.com Breck Yunits date 4/21/2024 groups All title ScrollSets: source code for CSVs @@ -9,7 +10,7 @@ import header.scroll keyboardNav mediumColumns 1 printTitle -byLine https://breckyunits.com Breck Yunits +printAuthor image scrollsets.png caption More examples of ScrollSets from sets.scroll.pub. diff --git a/blog/textFiles.scroll b/blog/textFiles.scroll index 059bc2fc3..fddcb1de8 100644 --- a/blog/textFiles.scroll +++ b/blog/textFiles.scroll @@ -1,3 +1,4 @@ +author https://breckyunits.com Breck Yunits date 4/29/2024 groups All title Scroll now generates text files @@ -6,7 +7,7 @@ import header.scroll keyboardNav printTitle -byLine https://breckyunits.com/ Breck Yunits +printAuthor thinColumns 1 diff --git a/grammar/author.grammar b/grammar/author.grammar index 2f780f24f..87dff4911 100644 --- a/grammar/author.grammar +++ b/grammar/author.grammar @@ -1,27 +1,37 @@ -byLineParser +printAuthorParser description Prints a byline with the author's name and optionally a link to them. extends abstractScrollParser cruxFromId - cells keywordCell urlCell - catchAllCellType personNameCell + // todo: we need pattern matching added to Grammar to support having no params or a url and personNameCell + cells keywordCell + catchAllCellType anyCell example // With Link: - byLine https://breckyunits.com Breck Yunits + printAuthor https://breckyunits.com Breck Yunits // No link: - byLine Breck Yunits + printAuthor Breck Yunits javascript compile() { - const link = this.getWord(1) - return `
by ${this.name}
` + const {link, name} = this + return `
by ${name}
` + } + get link() { + return this.getWord(1) || this.parent.getNode("author")?.getWord(1) } get name() { - return this.getWordsFrom(2).join(" ") || this.parent.get("author") + return this.getWordsFrom(2).join(" ") || this.parent.getNode("author")?.getWordsFrom(2).join(" ") } compileTextVersion() { return `by ${this.name}` } +byLineParser + extends printAuthorParser + boolean isDeprecated true + description DEPRECATED! Use "printAuthor" instead. + authorParser + cells keywordCell urlCell catchAllCellType personNameCell description Set the author(s) for a post. Prints nothing by itself, but is printed with the title in text mode and in various metadata outputs. extends abstractTopLevelSingleMetaParser \ No newline at end of file diff --git a/grammar/pageFooter.grammar b/grammar/pageFooter.grammar index 92411c1ae..df6240a81 100644 --- a/grammar/pageFooter.grammar +++ b/grammar/pageFooter.grammar @@ -56,4 +56,5 @@ pageFooterParser gazetteFooterParser extends pageFooterParser + boolean isDeprecated true description DEPRECATED! Use "pageFooter" instead. \ No newline at end of file diff --git a/grammar/pageHeader.grammar b/grammar/pageHeader.grammar index 9b9474019..13712c8b0 100644 --- a/grammar/pageHeader.grammar +++ b/grammar/pageHeader.grammar @@ -57,4 +57,5 @@ pageHeaderParser gazetteHeaderParser extends pageHeaderParser + boolean isDeprecated true description DEPRECATED! Use "pageHeader" instead. diff --git a/package.json b/package.json index a4cc0446a..336f6a2a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scroll-cli", - "version": "90.5.0", + "version": "91.0.0", "description": "A language for scientists of all ages. A curated collection of tools for refining and sharing thoughts.", "main": "scroll.js", "engines": { diff --git a/releaseNotes.scroll b/releaseNotes.scroll index 605e6b85f..2583178c5 100644 --- a/releaseNotes.scroll +++ b/releaseNotes.scroll @@ -6,6 +6,10 @@ printTitle thinColumns +# 91.0.0 5/19/2024 +- 🎉 `printAuthor` keyword prints the author defined by `author`. `byLine` has been deprecated--replace with `printAuthor`. +- ⚠️ BREAKING: `author` keyword now takes a URL. + # 90.5.0 5/19/2024 - 🎉 added `printDate` keyword diff --git a/tests/kitchenSink/top-sinks.scroll b/tests/kitchenSink/top-sinks.scroll index 372f70598..cd0795ddd 100644 --- a/tests/kitchenSink/top-sinks.scroll +++ b/tests/kitchenSink/top-sinks.scroll @@ -1,3 +1,4 @@ +author https://breckyunits.com Breck Yunits date 1/11/2019 groups index all replace NUM_SINKS 283 @@ -17,7 +18,7 @@ import header.scroll printTitle -byLine https://breckyunits.com Breck Yunits +printAuthor keyboardNav