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

LucentMaster #3

Open
wants to merge 56 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
fd44340
Initial commit
pmitchev Oct 12, 2015
1ecc04b
README changed
pmitchev Oct 12, 2015
2f1c480
localhost used as seed node if no seed nodes are entered
pmitchev Oct 12, 2015
736dc3c
Remove temporary files
pmitchev Oct 12, 2015
a22075d
Analytics place changed
pmitchev Oct 12, 2015
d5dd54a
Cryptonote generator documentation added
pmitchev Oct 28, 2015
cdd0f17
Documentation added for Forknote 1.0.8.2
pmitchev Nov 25, 2015
c9568ac
Blog post about the 1.0.8.2 release was added
pmitchev Nov 25, 2015
a54bd7a
Site moved to Forknote 1.0.8.3
pmitchev Dec 1, 2015
fffe4c3
Adding Magnatoj icon
pmitchev Dec 1, 2015
ed89354
Documentation moved to v1.0.9
pmitchev Dec 12, 2015
0773e30
Blog post added
pmitchev Dec 15, 2015
b07b16d
Payment gateway example fixed
pmitchev Jan 15, 2016
f6e09de
Rakefile remove unused files
pmitchev Jan 15, 2016
3fdc87f
payment gateway docs updated to 1.0.9
pmitchev Jan 21, 2016
3bdf7e0
Small fixes
pmitchev Jan 21, 2016
c64dcb5
Premined json exported file fix
pmitchev Jan 23, 2016
9229ff9
Genesis tx is now populated in the creation form
pmitchev Feb 1, 2016
e3f98b8
Forknote 1.0.9.1 release
pmitchev Feb 20, 2016
e52273b
Create new blockchain tutorial updated
pmitchev Feb 21, 2016
c1e5dd8
Coins' info refreshed
pmitchev Feb 24, 2016
fede711
Minor text changes
pmitchev Feb 28, 2016
bc10c06
Added Bitaltcoin
pmitchev Mar 3, 2016
1111872
License change to CC
pmitchev Mar 12, 2016
37e7141
Download link updated
pmitchev Apr 15, 2016
983b8a9
Parameters updated to 1.0.10
pmitchev Apr 16, 2016
921605a
Documentation updated
pmitchev Apr 17, 2016
8ee4c78
Release note about 1.0.10 added
pmitchev Apr 22, 2016
8bd800f
Adding upgrade_height_v3 to docs
pmitchev Apr 30, 2016
1f36502
Change api port
pmitchev May 10, 2016
c77e521
Forknote v1.0.11
pmitchev Jul 2, 2016
1ef8893
Forknote 1.0.11 blog post
pmitchev Jul 2, 2016
c40ff1b
Blog post fixes
pmitchev Jul 2, 2016
d4d217d
Typo fix
pmitchev Jul 2, 2016
de55889
Version reverse
pmitchev Aug 17, 2016
6d53c01
Download link fixed
pmitchev Sep 8, 2016
c18c9a2
Added MAX_BLOCK_SIZE_INITIAL fix
pmitchev Oct 7, 2016
bcfd1c3
Change version to the newest release. Coins now leads to github repo
pmitchev Nov 11, 2016
32cf24f
Forknote v2.0.1 changes
pmitchev Jan 14, 2017
15901c8
version update
pmitchev May 10, 2017
b687767
version update
pmitchev May 10, 2017
76200e9
version change
pmitchev May 28, 2017
5b85d6e
v2.0.6 release
pmitchev Jun 14, 2017
d6a3843
version changed to 2.0.6.1
trendscharts Jul 29, 2017
8daa9c3
v2.1.0
trendscharts Aug 21, 2017
0b988ca
Version changed to v2.1.0.1
trendscharts Aug 23, 2017
c223d11
Adding
trendscharts Aug 24, 2017
606e670
Adding line for zawy
trendscharts Aug 26, 2017
a3ac511
v2.1.1
trendscharts Sep 14, 2017
8ff92f1
Documentation fix
trendscharts Sep 14, 2017
354b044
v2.1.2 released
trendscharts Oct 18, 2017
b8e9b44
Zawy diff is refactored to ZAWY_DIFFICULTY_BLOCK_INDEX. Old format is…
trendscharts Feb 1, 2018
ccaa66b
Ruby version update
trendscharts Feb 1, 2018
afab6ee
Adding missing extensions in the create form
trendscharts Feb 1, 2018
637b506
Documentation update
trendscharts Feb 6, 2018
ba9e8e6
Start moving to multicore
trendscharts Mar 29, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
output/
tmp/
Gemfile.lock
crash.log
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Found a typo? Have an idea for improving the docs? Feel free to open a pull request and we'll get it merged as soon as we can!

If you have a specific question or issues with the API, please [let us know](http://forknote.net/contact).
24 changes: 24 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
source "http://rubygems.org"

ruby '~> 2.4.0'

gem 'builder'
gem 'coderay'
gem 'kramdown', '~> 1.8.0'
gem 'mime-types', '~> 1.16'
gem 'nanoc', '~> 3.8'
gem 'nokogiri', '~> 1.6.0'
gem 'rouge', '~> 1.4'
gem 'rake', '~> 0.9.2'
gem 'thin'
gem 'yajl-ruby'

group :development do
gem 'adsf'
gem 'fssm'
gem 'guard-nanoc'
end

group :test do
gem 'html-proofer'
end
8 changes: 8 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'nanoc' do
watch('nanoc.yaml') # Change this to config.yaml if you use the old config file name
watch('Rules')
watch(%r{^(content|layouts|lib|static)/.*$})
end
139 changes: 139 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,140 @@
# forknote.net

This is a Forknote API resource built with [nanoc][nanoc].

All submissions are welcome. To submit a change, fork this repo, commit your changes, and send us a [pull request](http://help.github.com/send-pull-requests/).

## Setup

Ruby 1.9 is required to build the site.

Get the nanoc gem, plus kramdown for Markdown parsing:

```sh
$ bundle install
```

You can see the available commands with nanoc:

```sh
$ bundle exec nanoc -h
```

Nanoc has [some nice documentation](http://nanoc.ws/docs/tutorial/) to get you started. Though if you're mainly concerned with editing or adding content, you won't need to know much about nanoc.

[nanoc]: http://nanoc.ws/

## Styleguide

Not sure how to structure the docs? Here's what the structure of the
API docs should look like:

# API title

* TOC
{:toc}

## API endpoint title

[VERB] /path/to/endpoint

### Parameters

Name | Type | Description
-----|------|--------------
`name`|`type` | Description.

### Input (request JSON body)

Name | Type | Description
-----|------|--------------
`name`|`type` | Description.

### Response

<%= headers 200, :pagination => default_pagination_rels, 'X-Custom-Header' => "value" %>
<%= json :resource_name %>

**Note**: We're using [Kramdown Markdown extensions](http://kramdown.gettalong.org/syntax.html), such as definition lists.

### JSON Responses

We specify the JSON responses in Ruby so that we don't have to write
them by hand all over the docs. You can render the JSON for a resource
like this:

```erb
<%= json :issue %>
```

This looks up `GitHub::Resources::ISSUE` in `lib/resources.rb`.

Some actions return arrays. You can modify the JSON by passing a block:

```erb
<%= json(:issue) { |hash| [hash] } %>
```

### Terminal blocks

You can specify terminal blocks with `pre.terminal` elements. (It'd be nice if
Markdown could do this more cleanly.)

```html
<pre class="terminal">
$ curl foobar
....
</pre>
```

This is not a `curl` tutorial though. Not every API call needs
to show how to access it with `curl`.

## Development

Nanoc compiles the site into static files living in `./output`. It's
smart enough not to try to compile unchanged files:

```sh
$ bundle exec nanoc compile
Loading site data...
Compiling site...
identical [0.00s] output/css/960.css
identical [0.00s] output/css/pygments.css
identical [0.00s] output/css/reset.css
identical [0.00s] output/css/styles.css
identical [0.00s] output/css/uv_active4d.css
update [0.28s] output/index.html
update [1.31s] output/v3/gists/comments/index.html
update [1.92s] output/v3/gists/index.html
update [0.25s] output/v3/issues/comments/index.html
update [0.99s] output/v3/issues/labels/index.html
update [0.49s] output/v3/issues/milestones/index.html
update [0.50s] output/v3/issues/index.html
update [0.05s] output/v3/index.html

Site compiled in 5.81s.
```

You can setup whatever you want to view the files. If using the adsf
gem (as listed in the Gemfile), you can start Webrick:

```sh
$ bundle exec nanoc view
$ open http://localhost:3000
```

Compilation times got you down? Use `autocompile`!

```sh
$ bundle exec nanoc autocompile
```

This starts a web server too, so there's no need to run `nanoc view`.
One thing: remember to add trailing slashes to all nanoc links!

## Deploy

```sh
$ bundle exec rake publish
```
80 changes: 80 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
require 'nanoc3/tasks'
require 'tmpdir'

task :default => [:test]

desc "Compile the site"
task :compile do
`nanoc compile`
end

desc "Test the output"
task :test => [:clean, :remove_output_dir, :compile] do
require 'html/proofer'
ignored_links = [%r{www.w3.org}]
HTML::Proofer.new("./output", :href_ignore => ignored_links, :href_swap => href_swap).run
end

desc "Remove the output dir"
task :remove_output_dir do
FileUtils.rm_r('output') if File.exist?('output')
end

# Prompt user for a commit message; default: P U B L I S H :emoji:
def commit_message(no_commit_msg = false)
publish_emojis = [':boom:', ':rocket:', ':metal:', ':bulb:', ':zap:',
':sailboat:', ':gift:', ':ship:', ':shipit:', ':sparkles:', ':rainbow:']
default_message = "P U B L I S H #{publish_emojis.sample}"

unless no_commit_msg
print "Enter a commit message (default: '#{default_message}'): "
STDOUT.flush
mesg = STDIN.gets.chomp.strip
end

mesg = default_message if mesg.nil? || mesg == ''
mesg.gsub(/'/, '') # Allow this to be handed off via -m '#{message}'
end

desc "Publish to http://forknote.net"
task :publish, [:no_commit_msg] => [:clean, :remove_output_dir] do |t, args|
mesg = commit_message(args[:no_commit_msg])
sh "nanoc compile"

# save precious files
if ENV['IS_HEROKU']
`git checkout origin/gh-pages`
else
`git checkout gh-pages`
end
tmpdir = Dir.mktmpdir
`git checkout master`

ENV['GIT_DIR'] = File.expand_path(`git rev-parse --git-dir`.chomp)
ENV['RUBYOPT'] = nil
old_sha = `git rev-parse refs/remotes/origin/gh-pages`.chomp
Dir.chdir('output') do
ENV['GIT_INDEX_FILE'] = gif = '/tmp/dev.gh.i'
ENV['GIT_WORK_TREE'] = Dir.pwd
File.unlink(gif) if File.file?(gif)
# restore precious files
FileUtils.rm_rf(tmpdir) if File.exists?(tmpdir)
`git add -A`
tsha = `git write-tree`.strip
puts "Created tree #{tsha}"
# Heroku runs git@1.7, we don't have the luxury of -m
if ENV['IS_HEROKU']
`echo #{mesg} > changelog`
csha = `git commit-tree #{tsha} -p #{old_sha} < changelog`.strip
elsif old_sha.size == 40
csha = `git commit-tree #{tsha} -p #{old_sha} -m '#{mesg}'`.strip
else
csha = `git commit-tree #{tsha} -m '#{mesg}'`.strip
end
puts "Created commit #{csha}"
puts `git show #{csha} --stat`
puts "Updating gh-pages from #{old_sha}"
`git update-ref refs/heads/gh-pages #{csha}`
`git push origin gh-pages`
end
end
71 changes: 71 additions & 0 deletions Rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env ruby

# A few helpful tips about the Rules file:
#
# * The order of rules is important: for each item, only the first matching
# rule is applied.
#
# * Item identifiers start and end with a slash (e.g. “/about/” for the file
# “content/about.html”). To select all children, grandchildren, … of an
# item, use the pattern “/about/*/”; “/about/*” will also select the parent,
# because “*” matches zero or more characters.

# Reset search-index by deleting it every time
preprocess do
File.delete("output/search-index.json") if File.exists?("output/search-index.json")
end

compile '/static/*' do
end

compile '/CNAME/' do
end

compile '/blog/feed/' do
filter :erb
filter :kramdown, :toc_levels => [2]
end

route 'blog/feed' do
'/blog.atom'
end

compile '/blog/*' do
filter :search
filter :erb
filter :kramdown, :toc_levels => [2]
filter :colorize_syntax,
:colorizers => {:javascript => :rouge}

layout item[:layout] || 'posts'
end

compile '*' do
filter :erb
filter :kramdown, :toc_levels => [2]
filter :colorize_syntax,
:colorizers => {:javascript => :rouge}
layout item[:layout] || 'default'
end

route '/static/*' do
item.identifier[7..-2]
end

route '/CNAME/' do
'/CNAME'
end

route '/feed' do
'/posts.atom'
end

route '/404/' do
'/404.html'
end

route '*' do
item.identifier + 'index.html'
end

layout '*', :erb
51 changes: 51 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# A list of file extensions that nanoc will consider to be textual rather than
# binary. If an item with an extension not in this list is found, the file
# will be considered as binary.
text_extensions: [ 'css', 'erb', 'haml', 'htm', 'html', 'js', 'less', 'markdown', 'md', 'php', 'rb', 'sass', 'scss', 'txt', 'xhtml', 'xml', 'atom' ]

# The path to the directory where all generated files will be written to. This
# can be an absolute path starting with a slash, but it can also be path
# relative to the site directory.
output_dir: output

# A list of index filenames, i.e. names of files that will be served by a web
# server when a directory is requested. Usually, index files are named
# “index.hml”, but depending on the web server, this may be something else,
# such as “default.htm”. This list is used by nanoc to generate pretty URLs.
index_filenames: [ 'index.html' ]

# Whether or not to generate a diff of the compiled content when compiling a
# site. The diff will contain the differences between the compiled content
# before and after the last site compilation.
enable_output_diff: false

# The data sources where nanoc loads its data from. This is an array of
# hashes; each array element represents a single data source. By default,
# there is only a single data source that reads data from the “content/” and
# “layout/” directories in the site directory.
data_sources:
-
# The type is the identifier of the data source. By default, this will be
# `filesystem_unified`.
type: filesystem_unified

# The path where items should be mounted (comparable to mount points in
# Unix-like systems). This is “/” by default, meaning that items will have
# “/” prefixed to their identifiers. If the items root were “/en/”
# instead, an item at content/about.html would have an identifier of
# “/en/about/” instead of just “/about/”.
items_root: /

# The path where layouts should be mounted. The layouts root behaves the
# same as the items root, but applies to layouts rather than items.
layouts_root: /

-
type: static
items_root: /static

# For the atom feed.
base_url: http://forknote.net

# Articles per page for the blog
page_size: 5
Loading