![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Enoki is a powerfully simple set of tools and interfaces for creating and managing websites and single-page-apps. It’s as vanilla as possible, meant to get out of your way, and play nice with traditional tooling as well as unique environments, such as the peer-to-peer Beaker Browser.
Although fully-featured, Enoki is still early in development. Support for other frameworks and syntax styles are on the roadmap. If something you’d like to see is missing, please feel free to contribute!
Although the Enoki library can be used in a variety of ways, for the sake of example let’s just create a fresh little Choo app and require enoki/choo
:
var choo = require('choo')
var app = choo()
app.use(require('enoki/choo')())
Create a /content
directory in the root of your project and make an index.txt
file. Pages (and sub-pages) are just folders with their own index.txt
files:
title: Enoki Example
----
text: Hey, not bad!
Inside your Choo views you can traverse your content with a super handy API:
var html = require('choo/html')
function view (state, emit) {
var page = state.page
var children = page().children().sort('title', 'asc').value()
return html`
<body>
<h1>${page.value('title')}</h1>
<article>${page.value('text')}</article>
<ul>
${children.map(renderChild)}
</ul>
</body>
`
function renderChild (props) {
var child = page(props)
return html`
<li>
<a href="${child.value('url')}">${child.value('title')}</a>
</li>
`
}
}
The web is becoming re-decentralized! You can use Enoki with Dat in an environment such as Beaker Browser by swapping Node’s fs
for the DatArchive
API. This enables real-time reading of the archives’s files. Ensure you’re using .readAsync()
.
When using Enoki in a Dat environment we use the DatArchive
API instead of Node’s fs
to read the archive’s files. However, over http
Enoki reads a static json
file for fallback.
If you’d like to output that static json
when developing your site you can use the Enoki cli
. It’s possible to watch your content directory for changes by using the --watch
flag.
enoki content
enoki content --watch
Enoki is early in development. If you’d like to see support for webpack, or whatever other tooling, feel free to contribute!
For specifics on formatting directories and files, take a look at the dependencies’ documentation.
smarkt
for parsing mixed key/value store and yaml plain text fileshypha
for turning folders and files into jsonEnoki exposes a super convenient way for traversing flat content state called nanopage
.
You can access it like so:
var Page = require('enoki/page')
Alternatively, if you’re using Choo you can access nanopage
over state:
state.page().title().value()
For a complete list of methods, take a look at the docs!
FAQs
A Choo plugin for reading a content directory with Hypha
We found that enoki demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.