Coder Social home page Coder Social logo

dmulholl / ark Goto Github PK

View Code? Open in Web Editor NEW
113.0 113.0 7.0 2.04 MB

A static website generator for people who enjoy the simpler things in life.

Home Page: https://www.dmulholl.com/docs/ark/master/

License: The Unlicense

Python 74.70% CSS 25.30%

ark's People

Contributors

dmulholl avatar gvwilson 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  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  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

ark's Issues

feat: use ivy.py instead of config.py for configuration

The root directory of my project is littered with configuration files; requiring the Ivy configuration file to be called config.py doesn't make its purpose obvious. One option would be to call it ivy.py; another would be to load the .ivy file as a Python source file; a third (my preferred option) would be to allow Ivy to read settings from an [ivy] section of setup.cfg.

I started working on that, then realized the order of operations makes it complicated: command-line args are parsed after the config file is loaded, so ivy --config filename becomes "load default config, parse arguments based on that information, then load a new configuration". (The same thing makes it difficult to implement a "change directory before executing" flag similar to make's -C flag.) Is this a change you'd be open to?

Preventing actions for specific commands

I have a event handler registered for ivy.events.Event.EXIT that copies figure files from src/*/whatever to docs/*/whatever. I want it to run for ivy build and ivy watch, but not for ivy clear. What's the right way to ensure this?

copying files without templates

I'm building an extension to include snippets of code in HTML pages. I'd like to store the snippets in the same directories as the page files, i.e., src/a/index.md will include src/a/one.py, src/a/two.py, and so on - it's easier to keep track of them this way than creating res/a/one.py, res/a/two.py, and so on. If I try this right now, Ivy tries to templatize src/a/one.py, which fails. Is there a way to tell it to copy some files below src rather than templatizing them (e.g., based on file extension)? Or should I put them under res?

Generating an index

I've added another extension to https://github.com/gvwilson/theme to generate an index, but I believe my approach has broken caching.

  1. The i shortcode in lib/mccole/extensions/index.py translates index entries into links, and as a side effect, records all index keys and the files they appear in. So far, so good.
  2. I want to define another shortcode to generate a list of all index entries for inclusion in an appendix. However, if the appendix page is not the last one to be generated, not all of the index entries will have been collectedl, and the index will be incomplete.
  3. I therefore use an "exit" event handler to to read the generated HTML back in and insert the generated index.

This approach is ugly; it also seems to confuse the file cache. Is there a better approach?

Q: how to generate a/index.html ?

I have:

.
`-- src
    |-- a
    |   `-- index.html
    |-- b
    |   `-- index.html
    `-- index.html

I would like to produce:

.
`-- out
    |-- a
    |   `-- index.html
    |-- b
    |   `-- index.html
    `-- index.html

so that /a/ and /b/ will be valid URLs. Right now, Ivy wants to generate:

.
`-- src
    |-- a.html
    |-- b.html
    `-- index.html

Is there a way to force the desired behavior (so that old URLs won't break)?

Failed to change fonts

I am trying to add Chinese fonts in graphite theme. I have downloaded necessary fonts in fonts\ folder and add it to fonts.css. After that, I tried to change graphite.css file's 57th line (maybe different in your device), from font-family: 'Crimson Text', Georgia, serif; to font-family: 'LXGW WenKai', sans-serif, but it didn't work after build and serve.

best way to package a theme?

What is the preferred way to package a theme that includes templates and resources as well as extensions?

  1. Create a zip file that people can download from GitHub and unzip in the root directory of their project?
  2. Create a Python package that has Ivy as a dependency and its own init command to install bundled resources?
  3. Something else?

review request: Ivy theme

I've created an Ivy theme called mccole in https://github.com/gvwilson/theme/, and would be very grateful for feedback. In particular, there are several places in the extensions where I check to see if the node argument is empty, and if so, bail out; this tells me that I'm triggering on the wrong event, but I don't know which one(s) to watch for instead.

Similarly, the theme creates lookup tables under ivy.site.config["mccole"] for its own use; in several places one extension checks to see if another extension has added information there yet or not, and if not, bails out - my instinct is that shouldn't be necessary if I listen for another event.

Finally:

  1. I tried to get attribute lists working with tables, but the Markdown parser doesn't seem to recognize them (see the example at the top of lib/mccole/extensions/tables.py). If there's a way to do this, I'd be very happy to rewrite the extension.
  2. I'm using a regular expression to find headings in pages rather than running the Markdown parser and searching the token stream (partly because I suspect it's faster, but also because I'm not familiar with Markdown's parsing cycle). If there's an easier way to do this, I'd be happy to rewrite to use it.

And thanks for documenting Ibis and shortcodes - they were easy to figure out.

p.s. it's my intention to use this theme (with better CSS) for https://teachtogether.tech/, https://stjs.tech/, and https://buildtogether.tech/ - all of the features are driven by those books' needs. I'm speaking with the https://pagedjs.org/ folks later this week to see about HTML-to-PDF generation as well.

Q: include files in themes?

Is there a way to put include files in themes, e.g., lib/whatever/inc? I have several snippets that are shared between templates, and including them in the template directory rather that in the root inc directory seems more portable. thx - Greg

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.