![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
choo-dat-hypha
Advanced tools
A Choo plugin for reading a content directory with Hypha
npm i choo-dat-hypha
Create a new Choo app and use the choo-dat-hypha
plugin.
var choo = require('choo')
var app = choo()
app.use(require('choo-dat-hypha')('/content'))
if (!module.parent) app.mount('body')
else module.exports = app
Format some plain text files using smarkt fields.
title: Technopastoral
----
date: January 19, 2038
----
tags:
- garden
- engineering
----
text: To deprogram oneself necessitates keeping to very specific schedules, which are what Foucault, once again, described as techniques of the self, echoing Seneca.
Organize them within a directory structure alongside media assets.
/content
/about
index.txt
/blog
/38-01-19-technopastoral
index.txt
header.jpg
index.txt
Now your content gets loaded into your Choo app’s state, and a route is created for each of your pages!
var chooDatHypha = require('choo-dat-hypha')
var archive = new DatArchive(window.location.toString())
chooDatHypha('/content', {
archive: archive,
render: false
})
archive
Provide your own instance of DatArchive, useful for instantiating once within your app.
render
Should Choo automatically re-render after content loads? Boolean value defaulting to true
.
To easily access the data for each of your pages simply compare the state.href
against your state.content
object in a composable function.
// wrapper.js
var xtend = require('xtend')
module.exports = wrapper
function wrapper (view) {
return function (state, emit) {
var page = state.content[state.href || '/'] || { }
return view(xtend(state, { page: page }), emit)
}
}
Now simply wrap your views!
// view.js
var html = require('choo/html')
var wrapper = require('./wrapper')
module.exports = wrapper(view)
function view (state, emit) {
return html`
<body>
The current page is ${state.page.title}
</body>
`
}
State is extended with these objects:
state.content = { }
state.hypha = {
error: '',
loaded: false,
isOwner: false,
p2p: false,
online: true
}
Emitting this event will reload state.content
.
Listen to this event for when content is loaded.
FAQs
A Choo plugin for reading a content directory with Hypha
The npm package choo-dat-hypha receives a total of 0 weekly downloads. As such, choo-dat-hypha popularity was classified as not popular.
We found that choo-dat-hypha 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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
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.