📜 Scroll

Build your own public domain newspaper

📜 Scroll: Build your own public domain newspaper.

Can you show me a screenshot?

What makes Scroll different?

Scroll is different than other static site generators in 3 ways.

  1. Instead of Markdown, Scroll uses the easily extendible Scrolldown, so you can invent new languages to better fit your content.
  2. Instead of supporting licenses, Scroll is 100% focused on public domain sites and everything is designed with that assumption.
  3. The default Scroll theme publishes all articles to a single page, so readers can read faster at a higher level, like reading a newspaper.

Can I use Scroll for building sites other than newspapers?

Yes! Scroll work great for blogs, collaborative databases, intranets and other types of static sites as well.

How do I get Scroll?

The instant way is to try Scroll in GitPod.

Scroll is a command line app you install on your local machine. Scroll requires basic familiarity with the command line and NodeJs >=14. If you do not have NodeJs on your machine, one way is to install n which makes it easy to get NodeJs.

If you would like to use Scroll but aren't familiar with the command line, please open an issue and we may be able to help.

Once you have NodeJs installed you can install from GitHub or npm. Scroll is scroll-cli on npm.

You can install from GitHub:

git clone https://github.com/publicdomaincompany/scroll cd scroll npm install -g .

Or you can install Scroll with npm by typing:

npm install -g scroll-cli

How do I use Scroll?

Scroll is a command line app. To see the commands type:

scroll help

Where do I get help?

Post an issue in this GitHub or email us.

What are some example sites using Scroll?

This page, BreckYunits.com and TreeDB.

What does the name Scroll refer to?

A scroll is a single folder containing Scrolldown files and a `scroll.settings` file. Scroll compiles those Scrolldown files into a static index.html page.

Scroll is also the name of the command line app that includes a simple fs watch app for live preview.

Scrolldown is the name of a Tree Language defined in this grammar.

What does a typical project folder look like?

A typical Scroll project folder, excluding the html files built by Scroll, looks like this:

📁yourDomainName.org about.scroll publishedArticle.scroll anImageInTheArticle.png scroll.settings

The `scroll.settings` file let's Scroll know that a folder contains a Scroll.

When you "build" a Scroll site, you are simply generating the `index.html` and `[article].html` files in the site's folder.

With Scroll your site's Scroll files and static files and generated html are all in one public folder and checked into version control. Though often you may want to add `*.html` to your `.gitignore`.

How do I save drafts?

Have a draft scroll next to your published scroll. For example:

📁drafts someDraft.scroll scroll.settings 📁yourDomainName.org publishedArticle.scroll scroll.settings

What file formats does Scroll use?

Scroll articles are written as Scrolldown files with the file extension `scroll`. The grammar for Scrolldown is defined here.

What language is Scroll written in?

The Scroll CLI app is written in plain Javascript and runs in Node.js. Scroll makes heavy use of Tree Languages. The CSS is written in Hakon. The HTML is written in stump.

TypeScript may be used in the future but Scroll may never get over 1kloc so that might not be necessary.

How does versioning of articles work?

Scroll is designed for git. A single article is stored as a single file tracked by git.

Why the single page layout?

Scroll is designed to make it easier for syntopic reading. Being able to scan the page like a newspaper. This allows you to read at a higher level—to "get in the author's head"— compared to reading one article at a time from beginning to end.

And if anyone prefers to read a scroll in a different way—they can! Scroll is for public domain sites. People are free to arrange the symbols any way they wish.

Will you make design decisions for non-public domain sites?

No.

Can I use Scroll for internal private sites not intended for publishing?

Yes!

In the single page layout why don't you have only the newest articles above the fold?

This was originally a bug. But then it turns out to be a feature, as it gives older articles, which are often more important, more visibility.

Is there a place I can play with the Scrolldown grammar and see how it compiles to HTML?

Yes. In the Tree Language Designer.

What's an easy way to have GitHub run Scroll and build my HTML files automatically?

Go to your project folder and create the file below:

mkdir -p .github/workflows touch .github/workflows/buildAndDeployScroll.yaml

Then open that file and paste in this code:

# Adapted from https://github.com/JamesIves/github-pages-deploy-action name: Build and Deploy Scroll on: push: branches: - main jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ uses: actions/checkout@v2.3.1 - name: Install and Build run: | npm install scroll-cli ./node_modules/scroll-cli/scroll.js build # Uncomment the line below if you are ignoring *.html files in your gitignore file # rm .gitignore - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@4.1.4 with: branch: scroll-output # The branch the action should deploy to. folder: .

Commit and push. Now go to your GitHub Repo and then `Settings`, then `Pages`, and select the `scroll-output` branch as the Source for the pages. Click save. Your built site should be live.

How do I check for broken links?

Scroll does not check for broken links. For that, try linkinator.

# npm install -g linkinator linkinator https://scroll.pub > brokenLinks.txt

How do I check browser performance?

Scroll does not have browser perf tools built in. For that, try lighthouse.

# npm install -g lighthouse lighthouse https://scroll.pub --output-path scrollBrowserPerf.html; open scrollBrowserPerf.html

Where should I host my site?

Any web server works. You can even host your scroll for free using GitHub Pages, just like this site.

How do I use Scroll with a custom domain?

Just buy a domain and point it to your web server or web host (such as GitHub Pages). Google Domains is where this domain is registered and is a great service.

How can I deploy my site?

If you have your own web server try rsync. Here's a bash one liner:

# deploy.sh # swap "/var/www/html" with the path to your website's location on your web server rsync -vr /[path/to/your/site]/* [yourdomain.com]:/var/www/html

Add a section like the one below to your ~.ssh/config to save your username and correct key pair.

Host example.com User yourUserName IdentityFile ~/.ssh/example_id_rsa IdentitiesOnly yes

How can I output my Scroll to an EPUB file?

Pandoc is one way to do it. If you are on a Mac and have Homebrew installed:

brew install pandoc pandoc index.html -o book.epub

How can I track web traffic?

Scroll emits HTML with zero Javascript and does not have any tracking or cookies. If you are using a web server like Nginx you might have some access logs on your server. The one liner below uses GoAccess to summarize recent Nginx access logs.

# apt-get install goaccess goaccess /var/log/nginx/access.log -o /var/www/html/YOUR_SECRET_REPORT_URL.html --log-format=COMBINED --real-time-html --ws-url=wss://YOURDOMAIN.com

Does Scroll support Open Graph tags for better social media sharing?

Yes. By default the first image and first paragraph of an article will be used for the "og:" tags. Unfortunately Twitter doesn't support relative image links so you need to specify `baseUrl` in your `scroll.settings` file. For more help check out the debuggers from Facebook and Twitter.

Does Scroll support themes?

Yes! Scroll includes a simple API for changing the style of your site. This is an active area of development so please reach out if you'd like to customize the look of your Scroll.

How can I build a scroll from a Twitter account?

Hopefully someone will build a package or site that does this. For now, on your Twitter settings, download an archive of your data and convert the tweets JSON into scroll files. Or to experiment faster use this tool to grab some tweets as a TSV.

What were some alternatives considered?

There was no publishing software that reads and writes Scrolldown yet so building Scroll was necessary. Jekyll and Brecksblog were the two biggest inspirations.

What has changed in recent versions?

View the releaseNotes.

Contributing to Scroll development

How do I contribute?

File issues. Share your Scroll sites.

You can submit pull requests too. The shorter the better.

How do I debug node.js performance?

# cd your_slow_scroll # you may need to update the path below so it points to your scroll code node --cpu-prof --cpu-prof-name=scrollNodePerf.cpuprofile ~/scroll/scroll.js build # Now ➡️ open a new Chrome tab ➡️ open devtools ➡️ click Performance ➡️ click "Load Profile..." ➡️ select your scrollNodePerf.cpuprofile

How do I format the Scrolldown Grammar file?

# Assuming you've already done `jtree register YOUR_PATH/jtree/langs/grammar/grammar.grammar` jtree format scrolldown.grammar

How do I run cross browser tests?

For that we use BrowserStack.

Article source

Gmail icon Twitter icon GitHub icon
Built with Scroll v22.1.0