Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
breck7 committed Sep 14, 2024
1 parent dc80fef commit 973a376
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 35 deletions.
62 changes: 34 additions & 28 deletions Computer.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,39 +420,39 @@ Wayback Machine: https://web.archive.org/web/20220000000000*/${title}`

this.particle.findParticles("example").forEach(particle => {
examples.push({
code: particle.childrenToString(),
code: particle.subparticlesToString(),
source: "the web",
link: ""
})
})

this.particle.findParticles("compilerExplorer example").forEach(particle => {
examples.push({
code: particle.childrenToString(),
code: particle.subparticlesToString(),
source: "Compiler Explorer",
link: `https://godbolt.org/`
})
})

this.particle.findParticles("rijuRepl example").forEach(particle => {
examples.push({
code: particle.childrenToString(),
code: particle.subparticlesToString(),
source: "Riju",
link: this.get("rijuRepl")
})
})

this.particle.findParticles("leachim6").forEach(particle => {
examples.push({
code: particle.getParticle("example").childrenToString(),
code: particle.getParticle("example").subparticlesToString(),
source: "hello-world",
link: `https://github.com/leachim6/hello-world/blob/main/` + particle.get("filepath")
})
})

this.particle.findParticles("helloWorldCollection").forEach(particle => {
examples.push({
code: particle.childrenToString(),
code: particle.subparticlesToString(),
source: "the Hello World Collection",
link: `http://helloworldcollection.de/#` + particle.getWord(1)
})
Expand All @@ -461,15 +461,15 @@ Wayback Machine: https://web.archive.org/web/20220000000000*/${title}`
const linguist_url = this.get("linguistGrammarRepo")
this.particle.findParticles("linguistGrammarRepo example").forEach(particle => {
examples.push({
code: particle.childrenToString(),
code: particle.subparticlesToString(),
source: "Linguist",
link: linguist_url
})
})

this.particle.findParticles("wikipedia example").forEach(particle => {
examples.push({
code: particle.childrenToString(),
code: particle.subparticlesToString(),
source: "Wikipedia",
link: this.get("wikipedia")
})
Expand Down Expand Up @@ -576,10 +576,10 @@ Wayback Machine: https://web.archive.org/web/20220000000000*/${title}`
return ""
}

const particle = Particle.fromSsv(table.childrenToString())
particle.forEach(child => {
child.set("repo", child.get("name"))
child.set("repoLink", child.get("url"))
const particle = Particle.fromSsv(table.subparticlesToString())
particle.forEach(subparticle => {
subparticle.set("repo", subparticle.get("name"))
subparticle.set("repoLink", subparticle.get("url"))
})
return `## Trending <a href="https://github.com/trending/${githubId}?since=monthly">${title} repos</a> on GitHub
table
Expand All @@ -599,9 +599,9 @@ table

if (items.content === "0") return ""

const particle = Particle.fromDelimited(items.childrenToString(), "|")
particle.forEach(child => {
child.set("titleLink", `https://www.semanticscholar.org/paper/${child.get("paperId")}`)
const particle = Particle.fromDelimited(items.subparticlesToString(), "|")
particle.forEach(subparticle => {
subparticle.set("titleLink", `https://www.semanticscholar.org/paper/${subparticle.get("paperId")}`)
})
return `## Publications about ${title} from Semantic Scholar
table
Expand All @@ -624,9 +624,9 @@ table

if (isbndb.content === "0") return ""

const particle = Particle.fromDelimited(isbndb.childrenToString(), "|")
particle.forEach(child => {
child.set("titleLink", `https://isbndb.com/book/${child.get("isbn13")}`)
const particle = Particle.fromDelimited(isbndb.subparticlesToString(), "|")
particle.forEach(subparticle => {
subparticle.set("titleLink", `https://isbndb.com/book/${subparticle.get("isbn13")}`)
})
return `## Books about ${title} from ISBNdb
table
Expand All @@ -642,9 +642,12 @@ table
const goodreads = this.getParticle(`goodreads`) // todo: the goodreadsIds we have are wrong.
if (!goodreads) return ""

const particle = Particle.fromDelimited(goodreads.childrenToString(), "|")
particle.forEach(child => {
child.set("titleLink", `https://www.goodreads.com/search?q=${child.get("title") + " " + child.get("author")}`)
const particle = Particle.fromDelimited(goodreads.subparticlesToString(), "|")
particle.forEach(subparticle => {
subparticle.set(
"titleLink",
`https://www.goodreads.com/search?q=${subparticle.get("title") + " " + subparticle.get("author")}`
)
})
return `## Books about ${title} on goodreads
table
Expand All @@ -662,9 +665,12 @@ table
const { title } = this
const dblp = this.getParticle(`dblp`)
if (dblp && dblp.get("hits") !== "0") {
const particle = Particle.fromDelimited(dblp.getParticle("publications").childrenToString(), "|")
particle.forEach(child => {
child.set("titleLink", child.get("doi") ? `https://doi.org/` + child.get("doi") : child.get("url"))
const particle = Particle.fromDelimited(dblp.getParticle("publications").subparticlesToString(), "|")
particle.forEach(subparticle => {
subparticle.set(
"titleLink",
subparticle.get("doi") ? `https://doi.org/` + subparticle.get("doi") : subparticle.get("url")
)
})
return `## ${dblp.get("hits")} publications about ${title} on <a href="${this.get("dblp")}">DBLP</a>
table
Expand Down Expand Up @@ -694,7 +700,7 @@ table
const supported = particle.content === "true"

table
.appendLineAndChildren(
.appendLineAndSubparticles(
`row`,
`Feature ${feature.title}
FeatureLink ${feature.titleLink}
Expand All @@ -703,7 +709,7 @@ Example
Token ${supported && tokenPath ? this.get(tokenPath) ?? "" : ""}`
)
.touchParticle("Example")
.setChildren(particle.childrenToString())
.setSubparticles(particle.subparticlesToString())
})

return `## Language <a href="../lists/features.html">features</a>
Expand All @@ -716,7 +722,7 @@ table
}

get hackerNewsTable() {
const hnTable = this.getParticle(`hackerNewsDiscussions`)?.childrenToString()
const hnTable = this.getParticle(`hackerNewsDiscussions`)?.subparticlesToString()
if (!hnTable) return ""

const table = Particle.fromDelimited(hnTable, "|")
Expand Down Expand Up @@ -1278,7 +1284,7 @@ codeWithHeader ${this.name} <a href="../lists/keywords.html#q=${this.id}">Keywor
.map(
fact =>
`codeWithHeader ${`<a href='${fact.content}'>Fun fact</a>`}:
${cleanAndRightShift(lodash.escape(fact.childrenToString()))}`
${cleanAndRightShift(lodash.escape(fact.subparticlesToString()))}`
)
.join("\n\n")
}
Expand Down Expand Up @@ -1432,7 +1438,7 @@ class Feature {
return {
id: file.id,
name: file.name,
example: this.tables.getConceptFile(file.id).getParticle(id).childrenToString()
example: this.tables.getConceptFile(file.id).getParticle(id).subparticlesToString()
}
})
const grouped = lodash.groupBy(examples, "example")
Expand Down
2 changes: 1 addition & 1 deletion blog/print-debugging-in-over-300-languages.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ table
__dirname + "/blog/does-every-programming-language-support-print-debugging.scroll"
)
)
const particle = Particle.fromCsv(code.getParticle("rawData").childrenToString())
const particle = Particle.fromCsv(code.getParticle("rawData").subparticlesToString())
const grouped = {}
particle.forEach(row => {
const obj = row.toObject()
Expand Down
4 changes: 2 additions & 2 deletions code/measures.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ abstractCodeMeasureParser
extends abstractTextareaMeasureParser
javascript
get measureValue() {
return this.childrenToString().replace(/[\n\t]/g, " ")
return this.subparticlesToString().replace(/[\n\t]/g, " ")
}

abstractRelationshipParser
Expand Down Expand Up @@ -96,7 +96,7 @@ nameParser
abstractFeatureParser
extends abstractBooleanMeasureParser
contentKey value
childrenKey example
subparticlesKey example
catchAllParser featureExampleCodeParser
float sortIndex 7
string sortKey abstractFeatureParser
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"lodash": "^4.17.21",
"monaco-editor": "^0.34.1",
"numeral": "^2.0.6",
"scroll-cli": "^131.0.0",
"scrollsdk": "^84.0.0",
"scroll-cli": "^132.0.0",
"scrollsdk": "^86.0.0",
"semver": "^7.6.2"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions scrollExtensions.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ohayoCodeParser
description Provide a direct link to analyze this data in Ohayo.
javascript
compile() {
const link = `https://ohayo.breckyunits.com?filename=${this.root.permalink}.ohayo&data=${encodeURIComponent(this.childrenToString())}`
const link = `https://ohayo.breckyunits.com?filename=${this.root.permalink}.ohayo&data=${encodeURIComponent(this.subparticlesToString())}`
return `<div class="scrollQuote">Analyze this data yourself in <a href="${link}">Ohayo</a></div>`
}
observableParser
Expand Down Expand Up @@ -47,7 +47,7 @@ monacoEditorParser
require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } })
require(["vs/editor/editor.main"], function() {
monaco.editor.create(document.getElementById('monacoContainer'), {
value: \`${this.childrenToString().replace(/\n/g, "\\n")}\`,
value: \`${this.subparticlesToString().replace(/\n/g, "\\n")}\`,
language: '${this.getWord(1)}',
minimap: {
enabled: false
Expand Down

0 comments on commit 973a376

Please sign in to comment.