Code Monkey home page Code Monkey logo

janetdocs's Introduction

janetdocs

A community documentation site for the janet programming language

Install janet

The first step is to get janet installed.

This uses homebrew for simplicity, but feel free to come up with whatever vagrant, docker or nixOS thing you'd like:

brew install janet

Get Started

After janet is installed there are a few steps to get this project up and running:

  1. Clone this repo
git clone https://github.com/swlkr/janetdocs.git
  1. Move .env.sample to .env
cd janetdocs
mv `.env.sample` `.env`
  1. Change the github client and secret ids to something real

You can create your own github oauth app or whatever it's called now to get your keys to get github sign in working

  1. Install deps
# make sure you're in the janetdocs directory
jpm deps
  1. Migrate the database
# make sure you're in the janetdocs directory
joy migrate
  1. Seed the database with the docs
# make sure you're in the janetdocs directory
janet seed.janet

And that's it! You should be able to poke around at this point and see what's going on, by default the server starts on port 9001:

# make sure you're in the janetdocs directory
janet main.janet

janetdocs's People

Contributors

felixr avatar ianthehenry avatar krasjet avatar mikebeller avatar pyrmont avatar roobie avatar swlkr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

janetdocs's Issues

Add option to add "see also" links to other functions

I think it would be useful be able to link to other functions that are related to the one you are currently looking at.

There are at least two good reasons for linking to other functions/etc:

1. Functions/macros that interact with each other

return (https://janetdocs.com/return) will always be used together with prompt (https://janetdocs.com/prompt). Users likely want to look at both docs in order to understand how they interact.

2. Improve discoverability of related functions

file/read (https://janetdocs.com/file%2fread) should link to slurp (https://janetdocs.com/slurp) to avoid users copying the read-from-file example instead of using slurp

Playground to add "Share" button?

Hi @swlkr -- I'd like to add a feature to the Playground to assist in sharing examples, but want to run by you the approach first. I'd like to add a "SHARE" button to the playground which saves the current playground code in the db as an "ad-hoc example", and returns a permalink. The user can then send the permalink to someone else who can see and run the code. Only a logged-in user could create one of these ad-hoc examples, I would put them in a separate table from the "real" examples, and I would tag the item in the db with the user's id. (in case of abuse for example)

My thought was to use the existing sqlite db to store these (but a new table as I said). But if you are not happy with the janetdocs db adding potentially tens of thousands of little briefly-used examples, I could create a separate db file for this.

What are your thoughts?

Fix joy shadowing

Functions like update for example were getting overridden with joy's docs

Help with test environment (for janet-playground pull request)

Hi @swlkr -- based on the conversation over at janet-lang/janet#570 in which you participated, I'm working on a PR to demonstrate integration of janet-playground into janetdocs.

I forked janetdocs and sort of got it running locally. But I had to guess at a bunch of things. (Like how to initialize the db, etc.)

Is there a test db? Is there an environment file I should use for testing? Can you disable the oauth for testing?

Any guidance would be appreciated.

-Mike

support substring search

concrete example:
searching for split doesn't bring up anything at all, but should at least list string/split.

fixed-width font in the example editor?

Heyo,

Have you considered using a fixed-width font in the examples editor?

I just modified the CSS locally and it seems to work well

textarea {
    font-family: monospace;
}

Parse examples and extract related from exammples

Today I was adding some ev/ examples, and I thought it would be great to parse them server-side. We can then be sure they are without parse errors, but also, we can extract other symbols and auto/manually assign them as related.

Nothing immediate, just an idea.

Get rid of markdown

Turns out this doesn't actually need markdown, plaintext + highlightjs will handle it ๐Ÿคทโ€โ™‚๏ธ

Please specify license

I thought about contributing a PR for janetdocs#24, but then noticed that the project has no license.
It would probably good in general to specify the license, but I, for example, cannot contribute unless the project is under one of my employer's approved open-source licenses.

Incorrect syntax highlighting in editor preview

For the following example in interleave:

# excess elements of the longer list are discarded
(interleave [1] 
            [2 4] 
            [3 6])
# -> @[1 2 3]

The # on the first line comments out the entire code snippet in preview mode,
pick-201213-223409
but the syntax highlighting behaves correctly after I submitted the example.
pick-201213-223448

I suspect it has something to do with how code are stored in textarea, but I am not familiar with highlight.js so unfortunately I can't locate the problem in the code.

Search not working

I'm finding that for me (on Debian Testing), the search functionality of the site is not working. Regardless of what I type into the search bar, nothing comes up. I can still manully type in the full url and get the docs and examples though. I tried this on both Firefox and Chromium.

Pressing return too quickly can take you to the wrong result

It turns out janetdocs hit the same bug which was in clojuredocs, ha! You are in good company :)

If I type array/remove and quickly hit enter, I am taken to array/concat.

If I type array/remove, then pause, then hit enter, I am taken to array/remove.

array/concat happened to be the top result of the most recent autocomplete ajax in the first case.

context: zk/clojuredocs#205

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.