From f368d38e04e26bfa116339310e6e0d53a1680a07 Mon Sep 17 00:00:00 2001 From: "David A. Harding" Date: Sat, 13 Dec 2014 17:35:21 -0500 Subject: [PATCH 1/4] Dev Docs: Add "Edit|History|Report Issue|Discuss" Links To Subheads --- Makefile | 20 +++++++++-- _includes/example_intro.md | 1 + _includes/example_p2p_networking.md | 6 ++++ _includes/example_payment_processing.md | 9 +++++ _includes/example_testing.md | 4 +++ _includes/example_transactions.md | 8 +++++ _includes/guide_block_chain.md | 8 +++++ _includes/guide_contracts.md | 5 +++ _includes/guide_mining.md | 8 +++++ _includes/guide_operating_modes.md | 8 +++++ _includes/guide_p2p_network.md | 9 +++++ _includes/guide_payment_processing.md | 15 +++++++++ _includes/guide_transactions.md | 16 +++++++++ _includes/guide_wallets.md | 17 ++++++++++ _includes/helpers/subhead-links.md | 8 +++++ _includes/ref_block_chain.md | 7 ++++ _includes/ref_core_rpc_intro.md | 17 ++++++++++ _includes/ref_core_rpcs-abcdefg.md | 44 +++++++++++++++++++++++++ _includes/ref_core_rpcs-hijklmn.md | 15 +++++++++ _includes/ref_core_rpcs-opqrst.md | 13 ++++++++ _includes/ref_core_rpcs-uvwxyz.md | 7 ++++ _includes/ref_p2p_networking.md | 30 +++++++++++++++++ _includes/ref_transactions.md | 10 ++++++ _includes/ref_wallets.md | 5 +++ _less/screen.less | 14 ++++++++ _plugins/liquid-die.rb | 29 ++++++++++++++++ en/developer-reference.md | 18 ---------- 27 files changed, 331 insertions(+), 20 deletions(-) create mode 100644 _includes/helpers/subhead-links.md create mode 100644 _plugins/liquid-die.rb diff --git a/Makefile b/Makefile index ff8bf1c3..8dc16b5b 100644 --- a/Makefile +++ b/Makefile @@ -33,13 +33,13 @@ all: pre-build-tests build post-build-tests ## Pre-build tests which, aggregated together, take less than 5 seconds to run on a typical PC -pre-build-tests-fast: check-for-non-ascii-urls +pre-build-tests-fast: check-for-non-ascii-urls check-for-wrong-filename-assignments ## Post-build tests which, aggregated together, take less than 5 seconds to run on a typical PC post-build-tests-fast: check-for-build-errors ensure-each-svg-has-a-png check-for-liquid-errors \ check-for-missing-anchors check-for-broken-markdown-reference-links \ check-for-broken-kramdown-tables check-for-duplicate-header-ids \ - check-for-headers-containing-auto-link + check-for-headers-containing-auto-link check-for-missing-subhead-links ## All pre-build tests, including those which might take multiple minutes pre-build-tests: pre-build-tests-fast @@ -134,3 +134,19 @@ check-for-headers-containing-auto-link: ## none of the generated subheadings contain the string ## 'class="auto-link"' produced by autocrossref $S grep '<\(h[2-6]\).*\?>[^>]\+class="auto-link".*' _site/en/developer-* | eval $(ERROR_ON_OUTPUT) + +check-for-missing-subhead-links: +## Make sure each subhead (h2-h6) either has the subhead links +## (edit,issue,etc) or something like + $S egrep -n -A1 ' #### Pay To Script Hash (P2SH) {:.no_toc} +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -355,6 +362,7 @@ Signature script: [sig] [sig...] #### Multisig {:.no_toc} +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -398,6 +406,7 @@ Signature script: OP_0 #### Pubkey {:.no_toc} +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -415,6 +424,7 @@ Signature script: #### Null Data {:.no_toc} +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -431,6 +441,7 @@ Pubkey Script: OP_RETURN <0 to 40 bytes of data> ~~~ #### Non-Standard Transactions +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -483,6 +494,7 @@ conditions: {% endautocrossref %} ### Signature Hash Types +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -545,6 +557,7 @@ hash types sign, including the procedure for inserting the subscript --> {% endautocrossref %} ### Locktime And Sequence Number +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -603,6 +616,7 @@ enable locktime. {% endautocrossref %} ### Transaction Fees And Change +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -642,6 +656,7 @@ outputs be sent to a new P2PKH or P2SH address. {% endautocrossref %} ### Avoiding Key Reuse +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -695,6 +710,7 @@ fixed URI to which payments should be sent, please see the {% endautocrossref %} ### Transaction Malleability +{% include helpers/subhead-links.md %} {% autocrossref %} diff --git a/_includes/guide_wallets.md b/_includes/guide_wallets.md index e9e37baf..bb2ceec9 100644 --- a/_includes/guide_wallets.md +++ b/_includes/guide_wallets.md @@ -2,8 +2,10 @@ This file is licensed under the MIT License (MIT) available on http://opensource.org/licenses/MIT. {% endcomment %} +{% assign filename="_includes/guide_wallets.md" %} ## Wallets +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -20,6 +22,7 @@ we're talking about wallet programs or wallet files. {% endautocrossref %} ### Wallet Programs +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -47,6 +50,7 @@ they control are spent. {% endautocrossref %} #### Full-Service Wallets +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -80,6 +84,7 @@ key or to read the decrypted keys from memory. #### Signing-Only Wallets +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -118,6 +123,7 @@ signing-only wallets: offline wallets and hardware wallets. {% endautocrossref %} ##### Offline Wallets +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -171,6 +177,7 @@ device and back. ##### Hardware Wallets +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -217,6 +224,7 @@ their intention to support at least one model of hardware wallet. #### Distributing-Only Wallets +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -250,6 +258,7 @@ Processing][devguide payment processing] section for details. ### Wallet Files +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -260,6 +269,7 @@ stored on pieces of paper. {% endautocrossref %} #### Private Key Formats +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -270,6 +280,7 @@ Private keys are what are used to unlock satoshis from a particular address. In {% endautocrossref %} ##### Wallet Import Format (WIF) +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -298,6 +309,7 @@ The process is easily reversible, using the Base58 decoding function, and removi {% endautocrossref %} ##### Mini Private Key Format +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -322,6 +334,7 @@ address utility]. #### Public Key Formats +{% include helpers/subhead-links.md %} {% autocrossref %} @@ -380,6 +393,7 @@ help programs identify how keys should be used: #### Hierarchical Deterministic Key Creation +{% include helpers/subhead-links.md %} #### Type 1: Single Chain Wallets + {% autocrossref %} @@ -19,6 +23,7 @@ sharing is extremely limited. {% endautocrossref %} #### Type 2: Hierarchical Deterministic (HD) Wallets + {% autocrossref %} diff --git a/_less/screen.less b/_less/screen.less index 6f015877..c3d1d344 100644 --- a/_less/screen.less +++ b/_less/screen.less @@ -766,18 +766,26 @@ table td,table th{ .toccontent h2{ font-size:150%; color:#383838; + margin-top: 30px; + margin-bottom: 0; } .toccontent h3{ font-size:130%; color:#383838; + margin-top: 30px; + margin-bottom: 0; } .toccontent h4{ font-size:110%; color:#383838; + margin-top: 30px; + margin-bottom: 0; } .toccontent h5,.toccontent h6{ font-size:100%; color:#383838; + margin-top: 30px; + margin-bottom: 0; } .toccontent img{ max-width:100%; @@ -797,6 +805,12 @@ table td,table th{ .toccontent:hover a.auto-link:visited:hover{ color:#63a4e1; } +.toccontent .subhead-links{ + visibility: hidden; +} +.toccontent:hover .subhead-links{ + visibility: visible; +} .toccontent a:link.term, .toccontent a:visited.term, .toccontent:hover a.auto-link.term:link, diff --git a/_plugins/liquid-die.rb b/_plugins/liquid-die.rb new file mode 100644 index 00000000..7e9f3012 --- /dev/null +++ b/_plugins/liquid-die.rb @@ -0,0 +1,29 @@ +# This file is licensed under the MIT License (MIT) available on +# http://opensource.org/licenses/MIT. + +## liquid-die.rb terminates site compilation in failure. This can allow +## us to avoid updating the site HTML with a broken layout + +## Example: +## {% if some_variable_is_set %} +## ...content... +## {% else %} +## {% die %} +## {% endif %} + +module Jekyll + + class LiquidDie < Liquid::Tag + + def initialize(tag_name, text, tokens) + super + end + + def render(context) + abort("Liquid die tag called. Dying...") + end + end +end + + +Liquid::Template.register_tag('die', Jekyll::LiquidDie) diff --git a/en/developer-reference.md b/en/developer-reference.md index 8dd8d46a..d9c1237e 100644 --- a/en/developer-reference.md +++ b/en/developer-reference.md @@ -44,28 +44,10 @@ title: "Developer Reference - Bitcoin" {% include ref_p2p_networking.md %} -## Bitcoin Core APIs - - -
{% include ref_core_rpc_intro.md %} -### Remote Procedure Calls (RPCs) - -**Warning:** the block chain and memory pool can include arbitrary data -which several of the commands below will return in hex format. If you -convert this data to another format in an executable context, it could -be used in an exploit. For example, displaying an output script as -ASCII text in a webpage could add arbitrary Javascript to that page and -create a cross-site scripting (XSS) exploit. To avoid problems, please -treat block chain and memory pool data as an arbitrary input from an -untrusted source. -
{% include ref_core_rpcs-abcdefg.md %} From 9718c474fb3b649de7f9e9f7b47d15ef088faa76 Mon Sep 17 00:00:00 2001 From: Saivann Date: Sat, 13 Dec 2014 20:06:30 -0500 Subject: [PATCH 2/4] Improve styles for actions in devel-docs Apply consistent title and paragraph margins Increase space between titles and actions for better readability Use a different font-size for actions to separate them from the content --- _less/screen.less | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/_less/screen.less b/_less/screen.less index c3d1d344..50dbfad1 100644 --- a/_less/screen.less +++ b/_less/screen.less @@ -763,29 +763,26 @@ table td,table th{ position:relative; text-align: left; } +.toccontent h2, +.toccontent h3, +.toccontent h4, +.toccontent h5, +.toccontent h6{ + color:#383838; + margin-top: 40px; + margin-bottom: 0; +} .toccontent h2{ font-size:150%; - color:#383838; - margin-top: 30px; - margin-bottom: 0; } .toccontent h3{ font-size:130%; - color:#383838; - margin-top: 30px; - margin-bottom: 0; } .toccontent h4{ font-size:110%; - color:#383838; - margin-top: 30px; - margin-bottom: 0; } .toccontent h5,.toccontent h6{ font-size:100%; - color:#383838; - margin-top: 30px; - margin-bottom: 0; } .toccontent img{ max-width:100%; @@ -807,6 +804,9 @@ table td,table th{ } .toccontent .subhead-links{ visibility: hidden; + font-size: 85%; + height: 18px; + padding-top: 7px; } .toccontent:hover .subhead-links{ visibility: visible; From 53d4a6eebeaadd4b1be8322b229d7f118c6fa17d Mon Sep 17 00:00:00 2001 From: "David A. Harding" Date: Sun, 14 Dec 2014 07:44:35 -0500 Subject: [PATCH 3/4] Dev Docs: Move Manual Sourcefile Lines To Auto Helper (thanks saivann!) --- _includes/helpers/subhead-links.md | 2 +- _less/screen.less | 5 ----- en/developer-examples.md | 8 -------- en/developer-guide.md | 16 ---------------- en/developer-reference.md | 18 ------------------ js/main.js | 2 +- 6 files changed, 2 insertions(+), 49 deletions(-) diff --git a/_includes/helpers/subhead-links.md b/_includes/helpers/subhead-links.md index 4a579199..973e670d 100644 --- a/_includes/helpers/subhead-links.md +++ b/_includes/helpers/subhead-links.md @@ -1,4 +1,4 @@ -{% if filename %}