GithubHelp home page GithubHelp logo

darkstrap's Introduction

danneu

My work-in-progress-but-functional Jekyll-inspired blog.

It's the idealogical successor of my Jekyll blog: github.com/danneu/danneu.github.com.

How it works

I wanted every post to be contained in its own subfolder so that images and even custom javascript, stylesheets, and live demos could also live within that folder.

The only required file for each post is a content.md Markdown file.

resources/
└── posts
    ├── 2012-02-02-darkstrap
    │   ├── content.md
    │   └── img
    │       └── comparison.png
    ├── 2012-04-11-meteor-tutorial
    │   └── content.md
    ├── 2012-04-24-anemone-tutorial
    │   └── content.md
    ├── 2012-04-29-rails-markdown-pygments-redcarpet-heroku
    │   └── content.md
    ├── 2012-05-11-rails-sitemap-tutorial
    │   └── content.md
    ├── 2012-06-05-mocha-coffeescript-tutorial
    │   └── content.md
    ├── 2012-10-23-sinatra-blog-tutorial
    │   └── content.md
    ├── 2012-10-30-xml-parsing-benchmark
    │   └── content.md
    └── 2013-02-09-discourse-plugin-tutorial
        ├── content.md
        └── img
            └── pervasive-banner-screenshot.png

At the top of each content.md post is a map of options sort of like the options at the top of a Jekyll post Markdown file.

Here's an example of the barebones post:

{:title "My First Post!"
 :permalink "my-first-post"}
 
# Hello World

I'm glad you're here to begin this adventure with me.

That post will be available at example.com/posts/my-first-post.

TODO

  • Extract static-file generator into standalone tool

This project is actually a test-bed of ideas that I'd like to eventually fasten into Jekyll-like tool.

The working title of my tool on localhost is "klobb".

Like,

$ klobb new myblog
(klobb creates barebones project in a `myblog/` folder)

$ cd myblog
$ klobb generate
(klobb parses myblog's posts into `myblog/site/`)

$ klobb server 3000
(klobb conveniently serves your blog at `http://localhost:3000/`)

If I embed Jetty as the web server, then the server command should be perfectly fine for production.

  • Read resources/posts/*/ from within the .jar

I haven't fully wrapped my head around the issue, but since I can't do File I/O operations on files within the .jar, this project only works if I run the compiled .jar from the app's root:

$ cd ~/Code/Clojure/danneu
$ lein uberjar
$ java -jar target/danneu-standalone.jar

I haven't fully wrapped my head around what's going on, but I believe this only works because the File I/O operations (grabbing all the posts within the resources folder) are working off relative paths.

The File operations don't work if I launch the .jar from an absolute path or a path outside the app's root:

$ java -jar ~/Code/Clojure/danneu/target/danneu-standalone.jar

The File operations in the danneu.post namespace (src/danneu/post.clj) fail and the blog appears as if it has no posts.

Looks like there might be a solution using Java's ZipInputStream.

See this Stackoverflow answer.

I'm adamant on the concept of dynamically generating posts from Markdown files in the resources/posts/ folder because my approach is to consider static HTML files as a caching layer. Jekyll's approach is to watch for changes in your source files to know when to regenerate associated HTML files. My approach is to simply toggle off HTML generation during development.

But this may change when I make more progress extracting the klobb tool.

  • Add memory caching

At the moment, it hilariously parses the Markdown on every request.

In the short term, I can solve this trivially by just caching the Markdown->HTML in memory.

But my plan is to eventually spit out HTML files. My two inspirations for this project are Jekyll and the page-caching of Ruby on Rails. So, like Rails page-caching, I want to be able to hit the Clojure stack until I decide to cache the page in HTML at which point the entire request is served by Nginx. Ruby on Rails does this beautifully and that's some swagger that needs to be jacked.

  • Move to server-side syntax highlighting

For now, I'm using Javascript for syntax highlighting: SyntaxHighlighter.

And only because the Markdown parser integrates with it: github.com/yogthos/markdown-clj.

But this introduces a Javascript dependency and forces every client to do work that the server can do once.

  • Use my own Markdown parser (Or give up and contribute to an existing Clojure parser)

While I've got the ball rolling (https://github.com/danneu/klobbdown), the grammar is not very pretty.

I basically want to have a Markdown parser that I can easily extend with some features I'd like for my static site generator. I have a few issues with the Java/Clojure solutions I've used.

But I'll first have to evaluate whether it'll be easier to struggle with my Klobbdown project or contribute to an existing Clojure parser.

  • Use a Sprockets-like asset pipeline

Especially since I plan on extracting this into a standalone tool, the app should minify and concatenate any CSS and JS files the user drops into some assets/ folder.

I got it implemented in a local branch using dieter, a "clojure interpretation of the ruby Sprockets library", but had some hangups getting it to work in production due to some issue with v8.

I'll have to revisit this and consider other solutions.

darkstrap's People

Contributors

chri5b avatar danneu avatar fbjerggaard avatar jamby avatar lbatson avatar simonrupf 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  avatar

Watchers

 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

darkstrap's Issues

Support CDN Glyphicons?

I'm not too familiar with bootstrap, so please correct me if i am wrong anywhere, but it seems that Darkstrap should remove the following two CSS rules.

[class^="icon-"],
[class*=" icon-"] {
  background-image: url("../img/glyphicons-halflings.png");
}

.icon-white,
.nav-pills > .active > a > [class^="icon-"],
.nav-pills > .active > a > [class*=" icon-"],
.nav-list > .active > a > [class^="icon-"],
.nav-list > .active > a > [class*=" icon-"],
.navbar-inverse .nav > .active > a > [class^="icon-"],
.navbar-inverse .nav > .active > a > [class*=" icon-"],
.dropdown-menu > li > a:hover > [class^="icon-"],
.dropdown-menu > li > a:hover > [class*=" icon-"],
.dropdown-menu > .active > a > [class^="icon-"],
.dropdown-menu > .active > a > [class*=" icon-"],
.dropdown-submenu:hover > a > [class^="icon-"],
.dropdown-submenu:hover > a > [class*=" icon-"] {
  background-image: url("../img/glyphicons-halflings-white.png");
}

Why? Well, it assumes that your Bootstrap is a local instalation, rather than a CDN installation from http://www.bootstrapcdn.com/.

Now, unless i am mistaken, there is no need for this correct? By removing it, the glyph location will default back to the original bootstrap location, which will be identified based on the location on the bootstrap css file. Supporting both CDN and local installations.

Thoughts?

Refactor Darkstrap to use Bootstrap's variables.

Darkstrap is a result of me judo'ing through Bootstrap CSS and copying my changes from Chrome's inspector into a text file.

A LOT of the work is redundant and can be solved with Bootstrap's robust variables.

Glyphs within tabs and headings should be white?

Shouldn't Line 146 be this?

[class^="icon-"], [class*=" icon-"] {
    background-image: url("../img/glyphicons-halflings-white.png");
}

Without it, glyphs within tabs (and headings look like this:
darkstrap_icon_issue

Update darkstrap to work with latest bootstrap

Hi danneu,

Are there any plans to update darkstrap to work with the newest bootstrap?

I love darkstrap but I keep itching to update to to a newer verison of bootstrap. The current version doesn't work so well with it, though!

Cheers,
Ryan

hero-unit still bright

the css class .hero-unit for the frontpages is still bright, i could fix this with adding the .well class but would be cooler if darkstrap can handle is automaticly

Bootstrap 3.0.0

Any plans of converting this to the new Bootstrap v3.0.0 ?

Demo is not responsive

Per #18,

[T]he demo is not responsive? Is this version of twitter bootstrap responsive?

http://danneu.com/bag/darkstrap/darkstrap.html

While the demo is not responsive, themes themselves are generally not responsive all on their own -- you need to include the bootstrap-responsive.css file prior to the theme's css.

I'm doing this on a project, and Darkstrap generally responds well. I am having an issue with dropdowns, but that may be the fault of my own implementation.

It would be nice to have the demo responsive, for... demo purposes.

Bootstrap 2.3.2 Support?

I see via the read me this works with 2.2.2, is 2.3.2 supported with the current release? If so just close this issue.

<Select> background color on Chrome

Not an urgent bug, but the background color of the <select> tag is totally black on Chrome, which is different and more darker from the <input> background color.

Blitzkrieg Mod API Manager Patches Create

Bootstrap 3 support?

Wondering if you were going to make further updates to be compliant with Bootstrap 3

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.