Commit 38b06e37 authored by feruz's avatar feruz
Browse files

Initial forkl

parents
_site/
.sass-cache/
.idea
vendor
node_modules/
.DS_Store
---
title: Contributors
position: 1
layout: full
---
Everyone is welcome to contribute code to Steemit, Inc. projects. We have a Code of Conduct;
we ask that you please follow it in all your interactions with our team and your fellow
contributors.
Please note that this contributing guide only applies to our development presence.
## Repositories
There are currently two repositories that you can contribute to:
1. Devportal [https://github.com/steemit/devportal](https://github.com/steemit/devportal)
2. Javascript Tutorials [https://github.com/steemit/devportal-tutorials-js](https://github.com/steemit/devportal-tutorials-js)
All of the repositories have a package.json file included with them with script helpers setup. To use these you will need the following packages installed:
1. [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/en/)
2. [prettier](https://github.com/prettier/prettier)
3. [eslint](https://eslint.org/)
These must all be installed in your development environment
Each of the repositories have the following scripts
`yarn lint` - performs linting validation on the codebase
`yarn fmt` - executes prettier to format the codebase
There is also a `precommit` script that will run both of these on committing of code to the repositoriy.
When contributing to the **DevPortal** all code snippets must be added to the `_includes/<tutorial name>` folder since this will be linted on commit. You can also wrap all your code in the tutorial in <code>```</code> tags which will force them to be highlighted in the portal.
## How to contribute
1. File an issue describing the problem you would like to solve or the feature you would like to add. It saves unnecessary work on your part, in case there's a nontechnical reason we can't accept a particular change. Please note that we can and will _automatically close all pull requests that do not refer to an issue_.
2. Learn the conventions of the project you are submitting code to, even implicit ones, and follow them. In case you have a question about a project's conventions, please ask on the issue you filed. This includes writing tests, formatting code, and documentation.
3. File a pull request against your Github issue and fill out the pull request template. Remember, you are agreeing to license your code and any intellectual property associated with your code under the same terms as the repository you are contributing to.
4. If one of our teammates asks you to make changes, please make them. Our rule is that all requests for changes in code review are resolved in favor of the reviewer. Our teammates follow this rule too!
## Code of Conduct
Again, please note that this Code of Conduct _only applies to our development presence_.
### Our Pledge
We welcome your membership in our project and community under the rules that we have set below.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers will work to make your participation in
our project and community as fulfilling as possible.
### Our Rules
All members of our project and community must:
1. Show empathy toward other project and community members
2. Use welcoming and inclusive language
3. Respect differing viewpoints and experiences
4. Gracefully accept constructive criticism
All members of our project and community must not:
1. Harm our project and community, or advocate harm to our project and community
2. Insult or make derogatory comments about others
3. Interact with others after they have withdrawn permission to do so
### Our Responsibilities
We will use any and all lawful means at our disposal to enforce our rules. This includes
but is not limited to:
1. Rejecting contributions
2. Removing comments, commits, code, wiki edits, and issues
3. Banning abusers
We will clarify standards of acceptable behavior and we will take appropriate
and fair corrective action in response to any instances of unacceptable behavior.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting us at github.abuse@steemit.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. We
maintain strict confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
### Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/gg
source 'https://rubygems.org'
gem 'jekyll'
gem 'neatjson'
gem 'rake'
gem 'git'
gem 'steem-ruby'
gem 'html-proofer'
group :jekyll_plugins do
gem 'jekyll-seo-tag'
gem 'jekyll-sitemap'
end
GEM
remote: https://rubygems.org/
specs:
activesupport (5.2.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
base58 (0.2.3)
bindata (2.4.4)
bitcoin-ruby (0.0.18)
colorator (1.1.0)
colorize (0.8.1)
concurrent-ruby (1.1.4)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
ethon (0.11.0)
ffi (>= 1.3.0)
eventmachine (1.2.7)
ffi (1.9.25)
forwardable-extended (2.6.0)
git (1.5.0)
hashie (3.6.0)
html-proofer (3.9.3)
activesupport (>= 4.2, < 6.0)
addressable (~> 2.3)
colorize (~> 0.8)
mercenary (~> 0.3.2)
nokogiri (~> 1.8.1)
parallel (~> 1.3)
typhoeus (~> 1.3)
yell (~> 2.0)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.8.5)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 2.0)
kramdown (~> 1.14)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.5.0)
jekyll (~> 3.3)
jekyll-sitemap (1.2.0)
jekyll (~> 3.3)
jekyll-watch (2.1.2)
listen (~> 3.0)
json (2.1.0)
kramdown (1.17.0)
liquid (4.0.1)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
multi_json (~> 1.10)
mercenary (0.3.6)
mini_portile2 (2.3.0)
minitest (5.11.3)
multi_json (1.13.1)
neatjson (0.8.4)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
parallel (1.12.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (3.0.3)
rake (12.3.2)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
rouge (3.3.0)
ruby_dep (1.5.0)
safe_yaml (1.0.4)
sass (3.7.2)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
steem-ruby (0.9.4)
base58 (~> 0.2, >= 0.2.3)
bindata (~> 2.4, >= 2.4.4)
bitcoin-ruby (~> 0.0, >= 0.0.18)
ffi (~> 1.9, >= 1.9.23)
hashie (~> 3.5, >= 3.5.7)
json (~> 2.1, >= 2.1.0)
logging (~> 2.2, >= 2.2.0)
thread_safe (0.3.6)
typhoeus (1.3.1)
ethon (>= 0.9.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
yell (2.0.7)
PLATFORMS
ruby
DEPENDENCIES
git
html-proofer
jekyll
jekyll-seo-tag
jekyll-sitemap
neatjson
rake
steem-ruby
BUNDLED WITH
1.16.5
The MIT License (MIT)
Copyright (c) 2016 CloudCannon
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
default: serve
serve: vendor
bundle exec jekyll serve --port 8080
vendor:
bundle install --path vendor/bundle
clean:
rm -rf _site
distclean: clean
rm -rf vendor
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'scrape/api_definitions_job'
require 'scrape/tutorials_job/base'
require 'scrape/tutorials_job/javascript'
require 'scrape/tutorials_job/python'
require 'scrape/tutorials_job/ruby'
require 'rake/testtask'
require 'net/https'
require 'json'
require 'yaml'
require 'html-proofer'
namespace :scrape do
desc "Scrape steemjs docs"
task :javascript do
end
desc "Scrape pysteem docs"
task :python do
end
desc "Scrape API Definitions"
task :api_defs do
url = ENV.fetch('TEST_NODE', 'https://api.steemit.com')
job = Scrape::ApiDefinitionsJob.new(url: url)
count = job.perform
puts "Methods added or changed: #{count}"
end
desc 'Scrape all known tutorial repositories.'
task :tutorials do
puts '=' * 80
puts "JS-Tutorials:"
Rake::Task["scrape:tutorials:js"].invoke
puts '=' * 80
puts "PY-Tutorials:"
Rake::Task["scrape:tutorials:py"].invoke
puts '=' * 80
puts "RB-Tutorials:"
Rake::Task["scrape:tutorials:rb"].invoke
end
namespace :tutorials do
desc 'Scrape JS-Tutorials'
task :js, [:num, :force] do |t, args|
job = Scrape::TutorialsJob::Javascript.new(num: args[:num], force: args[:force])
count = job.perform
puts "Tutorials added or changed: #{count}"
end
desc 'Scrape PY-Tutorials'
task :py, [:num, :force] do |t, args|
job = Scrape::TutorialsJob::Python.new(num: args[:num], force: args[:force])
count = job.perform
puts "Tutorials added or changed: #{count}"
end
desc 'Scrape RB-Tutorials'
task :rb, [:num, :force] do |t, args|
job = Scrape::TutorialsJob::Ruby.new(num: args[:num], force: args[:force])
count = job.perform
puts "Tutorials added or changed: #{count}"
end
end
end
namespace :production do
task :prevent_dirty_builds do
if `git status --porcelain`.chomp.length > 0
puts '*** WARNING: You currently have uncommitted changes. ***'
fail 'Build aborted, because project directory is not clean.' unless ENV['ALLOW_DIRTY']
end
end
task :build do
baseurl = ENV.fetch('BASEURL', '/')
cmd = 'bundle exec jekyll build --destination docs'
if !!baseurl && baseurl != '/'
cmd += " --baseurl #{baseurl}"
end
sh cmd
end
task :drop_previous_build do
sh 'git checkout master'
sh 'git rm -rf docs'
sh 'git commit -m "jekyll dropped previous site"'
end
desc "Deploy current master to GH Pages"
task deploy: [:prevent_dirty_builds, :drop_previous_build, :build] do
remote = ENV.fetch('REMOTE', 'origin')
sh 'git add -A'
sh 'git commit -m "jekyll base sources"'
sh "git push #{remote} master"
exit(0)
end
desc "Rollback GH Pages"
task rollback: [:prevent_dirty_builds] do
sh 'git checkout master'
sh 'git reset --hard HEAD^'
sh 'git push origin master'
exit(0)
end
desc "Make a clean build."
task :clean do
sh 'rm -rf _site && rm -rf docs && git checkout -- docs && git checkout -- _site'
end
end
desc 'Dump all operation types. Useful for schema comparison.'
task :ops_dump, [:vops, :appbase] do |t, args|
vops = args[:vops] == 'true'
appbase = args[:appbase] == 'true'
file_name = '_data/apidefinitions/broadcast_ops.yml'
op_names = []
yaml = YAML.load_file(file_name)
op_names += yaml[0]['ops'].map do |op|
next if op['virtual'] && !vops
if !!appbase
op['name'] + '_operation'
else
op['name']
end
end
puts op_names.compact.sort
end
namespace :test do
KNOWN_APIS = %i(
account_by_key_api account_history_api block_api condenser_api
database_api follow_api jsonrpc market_history_api network_broadcast_api
tags_api witness_api
)
desc "Tests the curl examples of api definitions. Known APIs: #{KNOWN_APIS.join(' ')}"
task :curl, [:apis] do |t, args|
smoke = 0
url = ENV.fetch('TEST_NODE', 'https://api.steemit.com')
apis = [args[:apis].split(' ').map(&:to_sym)].flatten if !!args[:apis]
apis ||= KNOWN_APIS
version = `curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_version", "params":[], "id":1}' #{url}`
version = JSON[version]['result']
blockchain_version = version['blockchain_version']
steem_rev = version['steem_revision'][0..5]
fc_rev = version['fc_revision'][0..5]
puts "node: #{url}; blockchain_version: #{blockchain_version}; steem_rev: #{steem_rev}; fc_rev: #{fc_rev}"
apis.each do |api|
file_name = "_data/apidefinitions/#{api}.yml"
unless File.exist?(file_name)
puts "Does not exist: #{file_name}"
next
end
yml = YAML.load_file(file_name)
yml[0]['methods'].each do |method|
print "Testing #{method['api_method']} ... "
if method['curl_examples'].nil?
puts "no curl examples."
next
end
method['curl_examples'].each_with_index do |curl_example, index|
response = `curl -s -w \"HTTP_CODE:%{http_code}\" --data '#{curl_example}' #{url}`
response = response.split('HTTP_CODE:')
json = response[0]
code = response[1]
case code
when '200'
data = JSON[json]
if !!data['error']
expected_curl_response = if !!method['expected_curl_responses']
method['expected_curl_responses'][index]
end
if !!expected_curl_response && data['error']['message'].include?(expected_curl_response)
print '√'
else
smoke += 1
print "\n\t#{data['error']['message']}\n"
end
else
print '√'
end
else
smoke += 1
'X'
end
end
print "\n"
end
end
exit smoke
end
desc 'Want some work to do? Run this report and get busy.'
task :proof do
# See: https://github.com/gjtorikian/html-proofer#configuration
sh 'bundle exec jekyll build'
options = {
assume_extension: true,
only_4xx: true,
check_favicon: true,
check_html: true,
allow_hash_href: true,
empty_alt_ignore: true
}
HTMLProofer.check_directory("./_site", options).run
end
end
---
title:
position:
type:
description:
---
---
title: Accounts
position: 1
---
\ No newline at end of file
---
title:
position:
type:
description:
---
---
position: 1
exclude: true
---
{% include api-template.html api_data=site.data.apidefinitions.account_by_key_api %}
\ No newline at end of file
---
position: 2
exclude: true
---
{% include api-template.html api_data=site.data.apidefinitions.account_history_api %}
---
position: 3
exclude: true
---
{% include api-template.html api_data=site.data.apidefinitions.block_api %}
---
position: 1
group: communities
exclude: true
---
{% include api-template.html api_data=site.data.apidefinitions.bridge %}
---
position: 100
exclude: true
---
Ops:
<ul>
{% for sections in site.data.apidefinitions.broadcast_ops_communities %}
{% assign sorted_ops = sections.ops | sort: 'name' %}
{% for op in sorted_ops %}
{% unless op.virtual %}
<li class="button"><a href="#broadcast_ops_communities_{{ op.name | slug}}">{{op.name | split: '.' | last}}</a></li>
{% endunless %}
{% endfor %}
{% endfor %}
</ul>
{% for sections in site.data.apidefinitions.broadcast_ops_communities %}
{{ sections.description | liquify | markdownify }}
{% for op in sections.ops %}
<ul style="float: right; list-style: none;">
{% if op.since %}
<li class="success"><strong><small>Since: {{op.since}}</small></strong></li>
{% endif %}
{% if op.virtual %}
<li class="info"><strong><small>Virtual Operation</small></strong></li>
{% endif %}
{% if op.deprecated %}
<li class="warning"><strong><small>Deprecated</small></strong></li>
{% endif %}
{% if op.disabled %}
<li class="warning"><strong><small>Disabled</small></strong></li>
{% endif %}
{% assign keywords = op.name | keywordify | escape %}
{% assign search_url = '/search/?q=' | append: keywords | split: '_' | join: ' ' %}
<li class="info"><strong><small><a href="{{ search_url | relative_url }}">Related <i class="fas fa-search fa-xs"></i></a></small></strong></li>
</ul>
<h4 id="broadcast_ops_communities_{{ op.name | slug }}">
<code>{{op.name}}</code>
<a href="#broadcast_ops_communities_{{ op.name | slug}}">
<i class="fas fa-link fa-xs"></i></a>
</h4>
{{ op.purpose | liquify | markdownify }}
<h5 id="{{ op.name | slug }}-roles">Roles: <code>{{op.roles}}</code></h5>
<h5 id="{{ op.name | slug }}-parameter">Parameters: <code>{{op.params}}</code></h5>
{% if op.json_examples %}
<h5 id="{{ op.name | slug }}-json-examples">Example Op:</h5>
{% for json_example in op.json_examples %}
```json
{{json_example | neat_json}}
```
{% endfor %}
{% endif %}
<hr />
{% endfor %}
{% endfor %}
---
position: 99
exclude: true
---
Ops:
<ul>
{% for sections in site.data.apidefinitions.broadcast_ops %}
{% assign sorted_ops = sections.ops | sort: 'name' %}
{% for op in sorted_ops %}
{% unless op.virtual %}
<li class="button"><a href="#broadcast_ops_{{ op.name | slug}}">{{op.name | split: '.' | last}}</a></li>
{% endunless %}
{% endfor %}
{% endfor %}