Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More documentation for site developers needed #89

Open
rask opened this issue Apr 20, 2015 · 3 comments
Open

More documentation for site developers needed #89

rask opened this issue Apr 20, 2015 · 3 comments

Comments

@rask
Copy link

rask commented Apr 20, 2015

I'm building a ZeroNet blogging platform from scratch using Backbone.js and JSON+Markdown data formats.

I'd like to see more documentation on the ZeroFrame file API and routing, among additions to the code examples provided.

Currently there are copy-pastes CoffeeScript examples available at the documentation page regarding fileGet (which I'm using succesfully to read JSON, Markdown and .html template files) and fileWrite (which I can't seem to get working properly).

I need to save blog post contents into Markdown files and the post meta (such as date, title, publish status and so on) into a general posts.json file. Currently the WebSocket connection is error closed when I'm trying to write a new Markdown file into a site subfolder. Do the files need to exist in the files construct of the content.json file in order allow fileWrite to work properly?

Routing is a bit of a mystery for me in the ZeroFrame API. There is code available in the ZeroBlog source, but I'd like to know how setting the site iframe's URL hash could be propagated to the ZeroFrame and onto the main browser window's URL hash.

Could the documentation be beefed up a bit to include pure JS examples that are not copy-pasted out of context (e.g. containing unknown variables and such)?

All additional information would be awesome. :)

@HelloZeroNet
Copy link
Owner

Yeah, the document definitely needs more work. I have made some modifications in fileWrite recently, its possible as side-effect the file already has to be in content.json before its allows writing (so needs to be created and zeronet.py siteSign youraddress executed). I'm going to test it later today.
Do you have any error in log/debug.log file?

@HelloZeroNet
Copy link
Owner

I have tried it and its works for me even for non-exitstent files, updated the sample application with file read/write example:
https://github.com/HelloZeroNet/Documentation/blob/master/example/ZeroFrame/index.html

Update: I was able to reproducate the problem, it happens when you dont have the "own": "true" at your site in data/sites.json. But the websocket dropping is not normal, already working on fixing it.

Update #2: Its got fixed in commit f576527

@rask
Copy link
Author

rask commented Apr 21, 2015

Oh okay. I created the site on another computer and I'm working on it on my home computer. Great to know! I'll test it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants