Skip to content

Commit

Permalink
Upgrade Scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Breck Yunits authored and Breck Yunits committed May 20, 2024
1 parent 12c13eb commit 627592e
Show file tree
Hide file tree
Showing 4,875 changed files with 8,950 additions and 4,071 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
62 changes: 33 additions & 29 deletions Computer.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,18 @@ const PLDBKeywords = {
}

class ConceptPage {
constructor(name, parsed, computer) {
const absolutePath = path.join(__dirname, "concepts", name + ".scroll")
this.absolutePath = absolutePath
constructor(parsed, computer) {
this.absolutePath = path.join(__dirname, "concepts", parsed.id + ".scroll")
this.computer = computer
this.parsed = parsed
this.node = new TreeNode(Disk.read(absolutePath))
this.node = new TreeNode(Disk.read(this.absolutePath))
this.quickCache = {}
}

get id() {
return this.parsed.id
}

get(word) {
return this.node.get(word)
}
Expand Down Expand Up @@ -511,7 +514,7 @@ Wayback Machine: https://web.archive.org/web/20220000000000*/${title}`
}

link(baseFolder = "") {
return `<a href="${baseFolder + this.permalink}">${this.title}</a>`
return `<a href="${baseFolder + this.permalink}">${this.name}</a>`
}

get extensions() {
Expand All @@ -536,7 +539,7 @@ Wayback Machine: https://web.archive.org/web/20220000000000*/${title}`

makeATag(id) {
const file = this.computer.getConceptPage(id)
return `<a href="${file.permalink}">${file.title}</a>`
return `<a href="${file.permalink}">${file.name}</a>`
}

get trendingRepos() {
Expand Down Expand Up @@ -694,6 +697,10 @@ pipeTable
return this.get("name")
}

get name() {
return this.get("name")
}

toScroll() {
const { primaryTagName, title, id } = this

Expand Down Expand Up @@ -1367,13 +1374,13 @@ class Feature {

const positives = this.languagesWithThisFeature
const positiveText = `* Languages *with* ${title} include ${positives
.map(file => `<a href="../concepts/${file.id}.html">${file.id}</a>`)
.map(file => `<a href="../concepts/${file.id}.html">${file.name}</a>`)
.join(", ")}`

const negatives = this.languagesWithoutThisFeature
const negativeText = negatives.length
? `* Languages *without* ${title} include ${negatives
.map(file => `<a href="../concepts/${file.id}.html">${file.id}</a>`)
.map(file => `<a href="../concepts/${file.id}.html">${file.name}</a>`)
.join(", ")}`
: ""

Expand All @@ -1389,7 +1396,7 @@ class Feature {
const grouped = lodash.groupBy(examples, "example")
const examplesText = Object.values(grouped)
.map(group => {
const links = group.map(hit => `<a href="../concepts/${hit.id.replace(".scroll", "")}.html">${hit.title}</a>`)
const links = group.map(hit => `<a href="../concepts/${hit.id}.html">${hit.name}</a>`)

return `codeWithHeader Example from <b>${links.length} languages</b>: ${links.join(", ")}
${shiftRight(removeReturnChars(lodash.escape(group[0].example)), 1)}`
Expand Down Expand Up @@ -1501,14 +1508,13 @@ class Tables {
const { pldb } = this
this._top = lodash
.chain(pldb)
.orderBy(["rank"], ["asc"])
.map(row =>
lodash.pick(row, [
"id",
"title",
"name",
"rank",
"appeared",
PLDBKeywords.tags,
"tags",
"creators",
"foundationScore",
"numberOfUsersEstimate",
Expand All @@ -1519,7 +1525,7 @@ class Tables {
)
.value()
.map(row => {
row.title = "../concepts/" + row.id + ".html"
row.nameLink = "../concepts/" + row.id + ".html"
delete row.id
return row
})
Expand Down Expand Up @@ -1547,16 +1553,15 @@ class Tables {
this._conceptPageCache = {}
this._conceptPages = []
this.pldb.forEach(file => {
const name = file.id
const page = new ConceptPage(name, file, this)
this._conceptPageCache[name] = page
const page = new ConceptPage(file, this)
this._conceptPageCache[file.id] = page
this._conceptPages.push(page)
})
}

getConceptPage(name) {
getConceptPage(id) {
this.initConceptPages()
return this._conceptPageCache[name.replace(".scroll", "")]
return this._conceptPageCache[id]
}

getLanguageTemplate(absolutePath) {
Expand Down Expand Up @@ -1663,7 +1668,7 @@ class Tables {
name: nameCol,
links: `<span class="creatorQuickLinks">${linksCol}</span>`,
born: person.born,
languages: group.map(file => `<a href='../concepts/${file.id}.html'>${file.id}</a>`).join(" - "),
languages: group.map(file => `<a href='../concepts/${file.id}.html'>${file.name}</a>`).join(" - "),
count: group.length,
topRank: group[0].rank
}
Expand All @@ -1690,8 +1695,8 @@ class Tables {
.filter(file => file.extensions)
.map(file => {
return {
name: file.id,
nameLink: `../concepts/${file}.html`,
name: file.name,
nameLink: `../concepts/${file.id}.html`,
rank: file.rank,
extensions: file.extensions
}
Expand All @@ -1718,7 +1723,7 @@ class Tables {
const entities = groupByListValues("originCommunity", files)
const rows = Object.keys(entities).map(name => {
const group = entities[name]
const languages = group.map(lang => `<a href='../concepts/${lang.id}.html'>${lang.id}</a>`).join(" - ")
const languages = group.map(lang => `<a href='../concepts/${lang.id}.html'>${lang.name}</a>`).join(" - ")
const count = group.length
const top = -Math.min(...group.map(lang => lang.rank))

Expand All @@ -1738,11 +1743,11 @@ class Tables {
get autocompleteJs() {
const json = JSON.stringify(
this.pldb.map(file => {
const permalink = file.id
const { id } = file
return {
label: file.id,
id: permalink,
url: `/concepts/${permalink}.html`
label: file.name,
id,
url: `/concepts/${id}.html`
}
}),
undefined,
Expand Down Expand Up @@ -1797,7 +1802,7 @@ class Tables {
row.langs = row.ids
.map(id => {
const file = this.getConceptPage(id)
return `<a href='../concepts/${file.id}.html'>${file.id}</a>`
return `<a href='../concepts/${file.id}.html'>${file.name}</a>`
})
.join(" ")
row.frequency = Math.round(100 * lodash.round(row.count / langsWithKeywordsCount, 2)) + "%"
Expand Down Expand Up @@ -1830,7 +1835,7 @@ class Tables {
"svg",
"explorer",
"gitignore"
].map(s => this.getConceptPage(s).parsed)
].map(id => this.getConceptPage(id).parsed)

const npmPackages = Object.keys({
...require("./package.json").devDependencies
Expand Down Expand Up @@ -1984,7 +1989,6 @@ class MeasureComputer {
.forEach(node => {
const links = node.content.split(" ")
links.forEach(link => {
link += ".scroll"
if (!inboundLinks[link]) throw new Error(`No file "${link}" found in "${id}"`)

inboundLinks[link].push(id)
Expand Down
5 changes: 3 additions & 2 deletions ScrollSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,16 @@ class ScrollSetCLI {

async updateIdsCommand() {
this.concepts.forEach(file => {
const tree = this.getTree(file)
const dest = path.join(this.conceptsFolder, file.filename)
const tree = new TreeNode(Disk.read(dest))
const newTree = tree.toString().replace(
`import ../code/conceptPage.scroll
id `,
`import ../code/conceptPage.scroll
id ${file.filename.replace(".scroll", "")}
name `
)
this.save(file, newTree.toString())
Disk.write(dest, newTree.toString())
})
}

Expand Down
3 changes: 3 additions & 0 deletions code/measures.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@ abstractIDRelationshipParser

idParser
extends abstractIdParser
boolean isMeasureRequired true
sortTemplate id appeared tags isFinished isPublicDomain screenshot photo demoVideo creators conceptDescription website webRepl documentation devDocumentation ebook emailList spec reference cheatSheetUrl standsFor oldName renamedTo aka fileExtensions country nativeLanguage originCommunity domainName equation firstAnnouncement announcementMethod usesSemanticVersioning releaseNotesUrl proposals roadmap versions abstractRelationshipParser visualParadigm abstractFeatureParser lineCommentToken multiLineCommentTokens printToken assignmentToken stringToken booleanTokens includeToken keywords example gource abstractGitRepoUrlMeasureParser repoStats funFact wikipedia githubLanguage githubBigQuery antlr monaco codeMirror pygmentsHighlighter linguistGrammarRepo languageServerProtocolProject projectEuler helloWorldCollection leachim6 rosettaCode quineRelay compilerExplorer rijuRepl replit tryItOnline indeedJobs linkedInSkill stackOverflowSurvey annualReportsUrl officialBlogUrl eventsPageUrl faqPageUrl downloadPageUrl abstractChatUrlMeasureParser subreddit meetup conference hackerNewsDiscussions redditDiscussion tiobe hopl esolang pypl packageRepository packageCount packageAuthors packageInstallCount forLanguages twitter ubuntuPackage gdbSupport jupyterKernel fileType wordRank isOpenSource githubCopilotOptimized centralPackageRepositoryCount goodreads isbndb semanticScholar

nameParser
extends abstractStringMeasureParser
boolean isMeasureRequired true
description What is the name of this concept?
int sortIndex 0.9

abstractFeatureParser
extends abstractBooleanMeasureParser
Expand Down
3 changes: 2 additions & 1 deletion concepts/05ab1e.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 05AB1E
id 05ab1e
name 05AB1E
appeared 2015
tags esolang

Expand Down
3 changes: 2 additions & 1 deletion concepts/1-pak.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 1.pak
id 1-pak
name 1.pak
appeared 1973
tags pl
reference https://pdfs.semanticscholar.org/5a43/c1b39643533b04a35f1811824c0c25d089fd.pdf?_ga=2.57752106.1877161244.1546024423-1663431151.1540068998
Expand Down
3 changes: 2 additions & 1 deletion concepts/1620sps.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id IBM 1620
id 1620sps
name IBM 1620
appeared 1959
tags assembly
originCommunity IBM
Expand Down
3 changes: 2 additions & 1 deletion concepts/1c-enterprise.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 1C Enterprise Script
id 1c-enterprise
name 1C Enterprise Script
appeared 2002
tags pl
conceptDescription The 1C:Enterprise platform allows for business oriented application development. The software allows work in thick, thin and web clients.[21] It also supports creating mobile applications for Android and iOS in the same environment using the 1C programming language
Expand Down
1 change: 1 addition & 0 deletions concepts/2-pak.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 2-pak
name 2-pak
appeared 1975
tags pl
reference https://www.ijcai.org/Proceedings/75/Papers/082.pdf
Expand Down
3 changes: 2 additions & 1 deletion concepts/20-gate.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 20-GATE
id 20-gate
name 20-GATE
appeared 1961
tags pl
originCommunity Bendix Corporation
Expand Down
1 change: 1 addition & 0 deletions concepts/2lisp.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 2lisp
name 2lisp
appeared 1982
tags pl
reference https://web.archive.org/web/20151022180515/http://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-272.pdf
Expand Down
3 changes: 2 additions & 1 deletion concepts/2obj.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 2OBJ
id 2obj
name 2OBJ
appeared 1995
tags pl
reference https://www.cs.cmu.edu/~mleone/language/projects.html
Expand Down
3 changes: 2 additions & 1 deletion concepts/3-lisp.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 3-LISP
id 3-lisp
name 3-LISP
appeared 1982
tags pl
reference https://books.google.com/books/about/Interim_3_LISP_Reference_Manual.html?id=sX6oHwAACAAJ
Expand Down
3 changes: 2 additions & 1 deletion concepts/3apl.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 3APL
id 3apl
name 3APL
appeared 1998
tags pl
reference https://semanticscholar.org/paper/5167cbb780bac55456a0f69c16f175eb61269c8d
Expand Down
3 changes: 2 additions & 1 deletion concepts/3d-logo.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 3D Logo
id 3d-logo
name 3D Logo
appeared 1986
tags pl
conceptDescription “3D Logo” for the Apple IIGS, which supports 3D drawing by rotating the turtle into or out of the screen
Expand Down
3 changes: 2 additions & 1 deletion concepts/3dcomposer.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 3DComposer
id 3dcomposer
name 3DComposer
appeared 1999
tags pl
reference https://semanticscholar.org/paper/6128962c90a401b57ce9a25b4b6f8d902c0ef869
Expand Down
3 changes: 2 additions & 1 deletion concepts/3ds.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 3DS
id 3ds
name 3DS
appeared 1990
tags binaryDataFormat
conceptDescription 3DS is one of the file formats used by the Autodesk 3ds Max 3D modeling, animation and rendering software.
Expand Down
3 changes: 2 additions & 1 deletion concepts/3mf.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 3D Manufacturing Format
id 3mf
name 3D Manufacturing Format
appeared 2015
tags xmlFormat
website http://www.3mf.io/specification/
Expand Down
3 changes: 2 additions & 1 deletion concepts/3rip.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 3RIP
id 3rip
name 3RIP
appeared 1977
tags pl
reference https://eric.ed.gov/?id=ED144615
Expand Down
3 changes: 2 additions & 1 deletion concepts/4g-standard.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 4G
id 4g-standard
name 4G
appeared 2013
tags standard

Expand Down
3 changes: 2 additions & 1 deletion concepts/4th-dimension.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 4th Dimension
id 4th-dimension
name 4th Dimension
appeared 1987
tags pl
reference https://en.wikipedia.org/wiki/4th_Dimension_(software)
Expand Down
1 change: 1 addition & 0 deletions concepts/51forth.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 51forth
name 51forth
appeared 1980
tags pl
originCommunity IDACOM Electronics or Hewlett-Packard
Expand Down
1 change: 1 addition & 0 deletions concepts/6gunz.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 6gunz
name 6gunz
appeared 2018
tags pl
demoVideo https://www.youtube.com/watch?v=afXzeCuUuhU
Expand Down
1 change: 1 addition & 0 deletions concepts/8th.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id 8th
name 8th
appeared 2014
tags pl
conceptDescription 8th is an innovative, secure, cross-platform, robust, and fun concatenative programming language for mobile, desktop, server, and embedded application development.
Expand Down
3 changes: 2 additions & 1 deletion concepts/a-0-system.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id A-0 system
id a-0-system
name A-0 system
appeared 1951
tags compiler
originCommunity Remington Rand
Expand Down
3 changes: 2 additions & 1 deletion concepts/a-sharp.scroll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ../code/conceptPage.scroll
id A#
id a-sharp
name A#
appeared 2004
tags pl
creators Dr. Martin C. Carlisle and Lt Col Ricky Sward and Maj Jeff Humphries
Expand Down
Loading

0 comments on commit 627592e

Please sign in to comment.