Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanreese committed Sep 14, 2024
1 parent 8da6d5d commit 28d0b3b
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 165 deletions.
45 changes: 7 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,22 @@ Everyone is welcome to contribute. Please feel free to edit _anything in the rep

### Pages

Each page is an HTML or Markdown file stored in the [pages](https://github.com/futureofcoding/wiki/tree/master/pages) folder.
Pages live in the [pages](https://github.com/futureofcoding/wiki/tree/master/pages) folder.

Note that we use a custom Markdown subset. See below for the supported syntax.
Note that we use a custom Markdown subset. See the Tonedown page for details.

The file should begin with "frontmatter", which is a fancy name for metadata using the following template:
Pages should begin with "frontmatter", which is a fancy name for metadata using the following template:

```yaml
---
title: Name of the Page
contributors: Comma-Separated, List of People, Who Contributed
---
This is the body of the page.
```

Yeah, that's it for now. We might add some other kinds of frontmatter soon — maybe a tagging scheme?

Use a `---` to mark the end of the frontmatter. After that, you can have normal HTML or Markdown, like so:

```yaml
title: An HTML Example
---
<p>Love to write tags. Not even joking.</p>
```

```yaml
title: A Markdown Example
---
This is a *very* simple page.
```

### Macros

While writing a page in either HTML or Markdown, you can use one of the following macros.

#### Internal Link
We use a format for links inspired by Wikipedia: `[[Page Name]]` or `[[Page Name|displayed text]]`

That's the only macro for now. We might add more soon.

### Markdown

We use a super-simple subset of Markdown syntax:

* Paragraphs: Bare text will be wrapped in `<p>` tags
* Headings: `#` for `<h1>`, `##` for `<h2>`, `###` for `<h3>`, `####` for `<h4>`
* Styling: `*` or `_` for `<em>`, `**` or `__` for `<strong>`
* Links:

### Build Scripts

This wiki uses a build script to do a few things:
Expand All @@ -65,6 +36,4 @@ This wiki uses a build script to do a few things:

If you edit the wiki via the Github web interface, the build script will run automatically on every commit.

If you make a local clone of the wiki repo, you'll see that there's a `scripts` folder, containing a few build scripts.
All the scripts do the same thing. Run whichever script is most convenient for you.
If none of the scripts are convenient, or if you're looking for something fun to do, please port or rewrite the build script in a language of your choice.
If you make a local clone of the wiki repo, you'll see that there's a `scripts` folder. Just ignore that for now — Ivan is still figuring out what it should be.
25 changes: 16 additions & 9 deletions assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ header {

@media(max-width: 800px) {
a#logo {
width: clamp(5em, 25vw, 10em);
width: 7em;
}
}

Expand Down Expand Up @@ -215,16 +215,18 @@ aside {
}

aside section h1 {
margin: 0 0 .5rem;
margin: 0;
border: none;
}

aside section ul {
margin: 0;
padding-left: 1em;
word-break: break-word;
}

aside section ul {
word-break: break-word;
aside section li {
margin-top: .15em;
}

article {
Expand Down Expand Up @@ -260,7 +262,7 @@ title {
display: block;
margin-bottom: .5em;
padding-bottom: .4em;
border-bottom: 3px solid currentcolor;
border-bottom: 4px solid currentcolor;
font-size: clamp(2em, 6vw, 3em);
font-weight: 300;
line-height: 1.1;
Expand All @@ -271,12 +273,16 @@ article h1 { font-size: clamp(1.6em, 4vw, 2em); }
article h2 { font-size: clamp(1.4em, 3vw, 1.5em); }
article h3 { font-size: clamp(1.2em, 2.5vw, 1.25em); }

h1 { border-bottom: 2px solid currentcolor }
h2 { border-bottom: 1px solid currentcolor }
h1 { border-bottom: 3px solid currentcolor }
h2 { border-bottom: 2px solid currentcolor }

h1, h2, h3 {
font-weight: 300;
margin: 1em 0 .5em;
margin: 1.5em 0 .5em;
}

h2 {
width: fit-content;
}

p {
Expand Down Expand Up @@ -334,11 +340,12 @@ blockquote {
}

ul {
margin: 1em 0;
list-style-type: square;
}

li + li {
margin-top: .7em;
margin-top: .5em;
}

li a {
Expand Down
67 changes: 42 additions & 25 deletions build/build.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
###
IGNORE THIS WHOLE FILE FOR NOW — IVAN IS STILL FIGURING OUT WHAT IT SHOULD BE
###






###
Future of Coding Wiki
CoffeeScript Build Script
Expand Down Expand Up @@ -72,6 +83,7 @@ indent = " "

# These Tonedown rewrite rules help us figure out which HTML element(s) to use for the following line(s) of input
lineRules =
" " : "skip"
"### ": "h3"
"## " : "h2"
"# " : "h1"
Expand Down Expand Up @@ -141,6 +153,11 @@ processLines = (page, lines)->
# Remove the mark and outer whitespace from the line
line = line.replace(mark, "").trim()

# This is a weird trick for not generating a <p> tag — just indent it by one or more spaces
if rule is "skip"
body += line + "\n"
continue

# If the line is now empty, bail
continue if line.length is 0

Expand All @@ -162,7 +179,7 @@ processLines = (page, lines)->

# Processing within a line
processInline = (page, line)->
chars = line.split ""
chars = Array.from line # Don't use .split("") because that doesn't handle multi-part unicode
out = ""

mode = {}
Expand Down Expand Up @@ -196,10 +213,7 @@ processInline = (page, line)->
# If the following char is one of our valid doubles, pull it too
char = checkForDouble char

if false
null

else if char is "[[" # Internal link
if char is "[[" # Internal link
str = consumeUntil "]]"
[text, title] = str.split "|"
title ||= text
Expand All @@ -216,6 +230,7 @@ processInline = (page, line)->
else if char is "["
str = consumeUntil ")"
[text, url] = str.split "]("
url = "https://#{url}" unless url.toLowerCase().startsWith "http"
out += "<a href=\"#{url}\">#{text}</a>"

else if char is "`"
Expand Down Expand Up @@ -307,37 +322,39 @@ for pageFilename in readDir "pages"
pages[page.data.title] = page


# BUILD THE PAGE BODY
for pageName, page of pages

# If this page is markdown, run it through our list of replacement rules
body = processLines page, page.body.split "\n"
page.html = processLines page, page.body.split "\n"

# Inject the page title as a visible title element
body = "\n#{indent}<title>#{page.data.title}</title>\n" + body

# Insert the page body into the layout
page.html = layout.replace /\s*{{page}}/, body

# Replace the string {{path}} with the path to this page file — used for Edit on GitHub link
page.html = page.html.replaceAll "{{path}}", page.sourcePath
page.html = "\n#{indent}<title>#{page.data.title}</title>\n" + page.html

# Replace the string {{all}} with links to all pages
page.html = page.html.replaceAll "{{all}}", Object.values(pages).map((p)-> li "<a href=\"#{p.url}\">#{p.data.title}</a>").join("\n")

page.html = page.html.replaceAll "{{contributors}}", page.data.contributors?.split(", ")?.map((c)->li "#{c}") or li "None"
# BUILD THE s
for pageName, page of pages
html = layout

null
# Replace the string {{path}} with the path to this page file — used for Edit on GitHub link
html = html.replaceAll "{{path}}", page.sourcePath

for pageName, page of pages
# Populate backlinks
# Replace the string {{contributors}} with the contributors section
html = html.replaceAll "{{contributors}}", if not page.data.contributors? then "" else
lis = page.data.contributors.split(",").map (c)-> li c.trim()
"<section><h1>Contributors</h1><ul>#{lis}</ul></section>"

backlinks = for title, url of page.backlinks
"<a href=\"#{url}\">#{title}</a>"
# Replace the string {{backlinks}} with the backlinks section
backlinks = ("<a href=\"#{url}\">#{title}</a>" for title, url of page.backlinks)
html = html.replaceAll "{{backlinks}}", if backlinks.length is 0 then "" else
lis = backlinks.map(li).join("")
"<section><h1>Backlinks</h1><ul>#{lis}</ul></section>"

if backlinks.length is 0
backlinks = ["None"]
# Replace the string {{page}} with the page body
html = html.replace /\s*{{page}}/, page.html

page.html = page.html.replaceAll "{{backlinks}}", backlinks.map(li).join "\n"
# Replace the string {{all}} with links to all pages
html = html.replaceAll "{{all}}", (li "<a href=\"#{p.url}\">#{p.data.title}</a>" for _, p of pages).join "\n"

# Finally, write the page content to the destination path.
writeFile page.destPath, page.html
writeFile page.destPath, html
18 changes: 4 additions & 14 deletions build/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<span>Edit This Page</span>
<img width="14" height="13" src="/edit.svg" alt="">
</a>
<a href="/">Home</a>
<a href="/all">List of All Pages</a>
<a href="/all">All Pages</a>
<a href="/search">Search</a>
</nav>
</header>

Expand All @@ -28,18 +28,8 @@
</article>

<aside>
<section>
<h1>Backlinks</h1>
<ul>
{{backlinks}}
</ul>
</section>
<section>
<h1>Contributors</h1>
<ul>
{{contributors}}
</ul>
</section>
{{backlinks}}
{{contributors}}
</aside>

</main>
Expand Down
2 changes: 1 addition & 1 deletion pages/all.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: All Pages
---

Here's a list of every page in the wiki. In the future, we'll add a search feature.
Here's a list of every page in the wiki.

<ul>
{{all}}
Expand Down
25 changes: 19 additions & 6 deletions pages/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,27 @@
title: Contributing
---

### Everyone is welcome to add and edit.
### Everyone is welcome to add and edit any part of the wiki.

Please note that all contributions are public domain, and are subject to the Future of Coding [Code of Conduct](https://github.com/futureofcoding/code-of-conduct).
Below are some brief instructions for editing the wiki. But note well: this wiki is fledgling. We're still figuring out how it should work. If any of these instructions don't make sense, or if you have other questions, head to the **#present-company** channel in [our Slack](https://futureofcoding.org/community) and let us know.

The wiki is a git repo, currently hosted on GitHub for convenience. When you make an edit, open a Pull Request and we'll promptly merge it.
The wiki is made of plain text files in a [repo on GitHub](http://github.com/futureofcoding/wiki). Feel free to clone the repo and edit it on your machine, or edit via the GitHub website. Whenever you make an edit, issue a pull request and we'll promptly merge it.

The wiki uses a subset of Markdown called [[Tonedown]].
We use a subset of Markdown called [[Tonedown]], which keeps the `.md` extension but removes some lesser-used features for the sake of simplicity.

When you edit a page, add your name to the list of Contributors.
Each page begins with some "frontmatter" enclosed by triple dashes, followed by the page content. Here's an example:

This wiki is fledgling. We're still figuring out how it should work. To discuss the wiki, please use the **#present-company** channel in [our Slack](https://futureofcoding.org/community).
```
---
title: Future of Coding (Podcast)
contributors: Ivan Reese, Kartik Agaram
---
The FoC community has [a podcast](futureofcoding.org/episodes) hosted by Ivan Reese, Jimmy Miller, and Lu Wilson.
```

The filename of each page is used for the URL, so keep that filename consistent with the title. For the example above, a good filename would be `future-of-coding-podcast.md`, so that the URL would be `/future-of-coding-podcast`.

When you edit a page, you're welcome to add your name to the list of contributors, if you'd like.

Please note that all contributions are public domain, and subject to our [Code of Conduct](https://github.com/futureofcoding/code-of-conduct). We have a very low tolerance for self-promotion of products or companies. When in doubt, talk to us on [Slack](https://futureofcoding.org/community).
8 changes: 4 additions & 4 deletions pages/future-of-coding.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
title: Future of Coding
---

The Future of Coding community was started back in 2017 to channel the groundswell of interest in revisiting the foundations of our industry and practice, looking for underexplored alternatives to the status quo. Swirling in the air were revolutionary talks by Alan Kay, essays by Bret Victor, and projects like Eve and Elm and Enso. Indie researchers Andy Matuschak, Hundred Rabbits, and Ink & switch were surging in popularity. All while the software platforms offered by Apple, Google, and Microsoft began to feel less like a bicycle for the mind and more like a department store for the disinclined.
The Future of Coding community was started back in 2017 to channel a recent groundswell of desire to revisit the foundations our industry and practice, looking for underexplored alternatives to the status quo. Swirling in the air were revolutionary talks by Alan Kay, essays by Bret Victor, and projects like Eve and Elm and Enso. Indie researchers like [Andy Matuschak](andymatuschak.org), [Hundred Rabbits](100r.co/), and [Ink & Switch](inkandswitch.com) were surging in popularity. At the same time, the software ecosystems controlled by Apple, Google, and Microsoft increasingly seemed less like bicycles for the mind and more like department stores for the disinclined.

The community is a worldwide collective of computing enthusiasts, academic researchers, startup founders, indie researchers, and even a few curious onlookers. Members host regular meetups in London, NYC, and online, and there are occasionally gatherings scattered across the globe.
This community is a worldwide collective of computing enthusiasts, academic researchers, startup founders, indie tinkerers, and quite a few curious onlookers. Members host regular meetups in London, NYC, and online, with smaller gatherings scattered across the globe.

There is no unifying thesis or mission. Rather, we all share an interest in considering why things got to be the way they are, and where we might like them to go from here. Some are champions of novel tools like richly expressive visual programming, profoundly helpful type systems, or proactive debugging, others champion the social causes the contribute to our software malaise such as the awful lack of diversity in tech or the err of attending to social issues with technical solutions. Some want to rip everything down to the foundation and start over, others just want a nicer way to find the needle in a React stack.
There is no unifying thesis or mission. Rather, we all share an interest in considering why things got to be the way they are, and where we might like them to go from here. Some members are enthusiastic about tools like visual programming, type systems, or omniscient debugging. Others raise awareness of the human factors the contribute to our software malaise, such as the awful lack of diversity in tech or the err of attending to social issues with technical solutions. An especially zealous cohort even want to rip everything down to the foundation and start over, bless their ambitious hearts.

The community is open and welcoming to all, and we invite you to join our deep discussions, enjoy our infrequently-published but lovingly crafted [podcast](https://futureofcoding.org/episodes), and [[contribute|Contributing]] to this wiki.
The community is open and welcoming to all. We invite you to join our deep discussions, enjoy our infrequently-published but lovingly crafted [podcast](https://futureofcoding.org/episodes), and [[contribute|Contributing]] to this wiki.
5 changes: 5 additions & 0 deletions pages/search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Search
---

In the future, we'll add a search feature.
Loading

0 comments on commit 28d0b3b

Please sign in to comment.