Merge branch 'notoc' (Pull #661: Convert Fake Subheadings To Real Subheadings)

This commit is contained in:
David A. Harding 2014-11-29 22:57:51 -05:00
commit ae54fc7194
No known key found for this signature in database
GPG key ID: 4B29C30FF29EC4B7
8 changed files with 65 additions and 24 deletions

View file

@ -38,7 +38,8 @@ pre-build-tests-fast: check-for-non-ascii-urls
## Post-build tests which, aggregated together, take less than 5 seconds to run on a typical PC ## 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 \ 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-missing-anchors check-for-broken-markdown-reference-links \
check-for-broken-kramdown-tables check-for-broken-kramdown-tables check-for-duplicate-header-ids \
check-for-headers-containing-auto-link
## All pre-build tests, including those which might take multiple minutes ## All pre-build tests, including those which might take multiple minutes
pre-build-tests: pre-build-tests-fast pre-build-tests: pre-build-tests-fast
@ -114,3 +115,22 @@ check-for-broken-kramdown-tables:
## paragraph starting with a | (pipe). I can't imagine any reason we'd ## paragraph starting with a | (pipe). I can't imagine any reason we'd
## have a regular paragraph starting with a pipe, so error on any occurences. ## have a regular paragraph starting with a pipe, so error on any occurences.
$S grep '<p>|' _site/en/developer-* | eval $(ERROR_ON_OUTPUT) $S grep '<p>|' _site/en/developer-* | eval $(ERROR_ON_OUTPUT)
check-for-duplicate-header-ids:
## When Kramdown automatically creates header id tags, it avoids using
## the same id="" as a previous header by silently appending '-1' to the
## second-occuring header. We want an error when this happens because
## all links which previously pointed to the second-occuring header now
## point to the first-occuring header. (Example: before this test was
## written, links pointing to the ping RPC were silently redirected when
## the P2P ping message was added to the page.) The pattern below will
## report a false positive if we legitimately have an id ending in '-1',
## but that should be easy to work around if it ever happens.
$S grep '<h[1-6][^>]\+id="[^"]\+-1"' _site/en/developer-* | eval $(ERROR_ON_OUTPUT)
check-for-headers-containing-auto-link:
## The autocrossref plugin can mess up subheadings (h2, etc), so ensure
## none of the generated subheadings contain the string
## 'class="auto-link"' produced by autocrossref
$S grep '<\(h[2-6]\).*\?>[^>]\+class="auto-link".*</\1>' _site/en/developer-* | eval $(ERROR_ON_OUTPUT)

View file

@ -320,7 +320,12 @@ backwards-incompatible features.
As of Bitcoin Core 0.9, the standard pubkey script types are: As of Bitcoin Core 0.9, the standard pubkey script types are:
**Pay To Public Key Hash (P2PKH)** {% endautocrossref %}
#### Pay To Public Key Hash (P2PKH)
{:.no_toc}
{% autocrossref %}
P2PKH is the most common form of pubkey script used to send a transaction to one P2PKH is the most common form of pubkey script used to send a transaction to one
or multiple Bitcoin addresses. or multiple Bitcoin addresses.
@ -332,9 +337,10 @@ Pubkey script: OP_DUP OP_HASH160 <PubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
Signature script: <sig> <pubkey> Signature script: <sig> <pubkey>
~~~ ~~~
{% autocrossref %} #### Pay To Script Hash (P2SH)
{:.no_toc}
**Pay To Script Hash (P2SH)** {% autocrossref %}
P2SH is used to send a transaction to a script hash. Each of the standard P2SH is used to send a transaction to a script hash. Each of the standard
pubkey scripts can be used as a P2SH redeem script, but in practice only the pubkey scripts can be used as a P2SH redeem script, but in practice only the
@ -347,9 +353,10 @@ Pubkey script: OP_HASH160 <Hash160(redeemScript)> OP_EQUAL
Signature script: <sig> [sig] [sig...] <redeemScript> Signature script: <sig> [sig] [sig...] <redeemScript>
~~~ ~~~
{% autocrossref %} #### Multisig
{:.no_toc}
**Multisig** {% autocrossref %}
Although P2SH multisig is now generally used for multisig transactions, this base script Although P2SH multisig is now generally used for multisig transactions, this base script
can be used to require multiple signatures before a UTXO can be spent. can be used to require multiple signatures before a UTXO can be spent.
@ -389,9 +396,10 @@ Redeem script: <OP_2> <A pubkey> <B pubkey> <C pubkey> <OP_3> OP_CHECKMULTISIG
Signature script: OP_0 <A sig> <C sig> <redeemScript> Signature script: OP_0 <A sig> <C sig> <redeemScript>
~~~ ~~~
{% autocrossref %} #### Pubkey
{:.no_toc}
**Pubkey** {% autocrossref %}
[Pubkey][]{:#term-pubkey}{:.term} scripts are a simplified form of the P2PKH pubkey script, [Pubkey][]{:#term-pubkey}{:.term} scripts are a simplified form of the P2PKH pubkey script,
but they arent as but they arent as
@ -405,9 +413,10 @@ Pubkey script: <pubkey> OP_CHECKSIG
Signature script: <sig> Signature script: <sig>
~~~ ~~~
{% autocrossref %} #### Null Data
{:.no_toc}
**Null Data** {% autocrossref %}
[Null data][]{:#term-null-data}{:.term} pubkey scripts let you add a small amount of arbitrary data to the block [Null data][]{:#term-null-data}{:.term} pubkey scripts let you add a small amount of arbitrary data to the block
chain in exchange for paying a transaction fee, but doing so is discouraged. chain in exchange for paying a transaction fee, but doing so is discouraged.

View file

@ -3,7 +3,7 @@ This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT. http://opensource.org/licenses/MIT.
{% endcomment %} {% endcomment %}
#### ping #### ping {#ping-rpc}
~~~ ~~~
ping ping

View file

@ -412,7 +412,8 @@ traffic dump this output was taken from, the full transaction belonging
to that TXID was sent immediately after the `merkleblock` message as to that TXID was sent immediately after the `merkleblock` message as
a `tx` message. a `tx` message.
**Parsing A MerkleBlock** ##### Parsing A MerkleBlock Message
{:.no_toc}
As seen in the annotated hexdump above, the `merkleblock` message As seen in the annotated hexdump above, the `merkleblock` message
provides three special data types: a transaction count, a list of provides three special data types: a transaction count, a list of
@ -483,7 +484,8 @@ For a detailed example of parsing a `merkleblock` message, please see
the corresponding [merkle block examples section][section merkleblock the corresponding [merkle block examples section][section merkleblock
example]. example].
**Creating A MerkleBlock** ##### Creating A MerkleBlock Message
{:.no_toc}
It's easier to understand how to create a `merkleblock` message after It's easier to understand how to create a `merkleblock` message after
you understand how to parse an already-created message, so we recommend you understand how to parse an already-created message, so we recommend

View file

@ -228,7 +228,8 @@ the [CompactSize section][CompactSize unsigned integer].
{% endautocrossref %} {% endautocrossref %}
**TxIn: A Transaction Input (Non-Coinbase)** ##### TxIn: A Transaction Input (Non-Coinbase) {#txin}
{:.no_toc}
{% autocrossref %} {% autocrossref %}
@ -244,7 +245,8 @@ Each non-coinbase input spends an outpoint from a previous transaction.
{% endautocrossref %} {% endautocrossref %}
**[Outpoint][]{:#term-outpoint}{:.term}: The Specific Part Of A Specific Output** ##### Outpoint: The Specific Part Of A Specific Output {#outpoint}
{:.no_toc}
{% autocrossref %} {% autocrossref %}
@ -259,7 +261,8 @@ specific output.
{% endautocrossref %} {% endautocrossref %}
**TxOut: A Transaction Output** ##### TxOut: A Transaction Output {#txout}
{:.no_toc}
{% autocrossref %} {% autocrossref %}
@ -313,8 +316,12 @@ to a new pay-to-pubkey-hash (P2PKH) output.
00000000 ................................... locktime: 0 (a block height) 00000000 ................................... locktime: 0 (a block height)
{% endhighlight %} {% endhighlight %}
{% endautocrossref %}
**Coinbase Input: The Input Of The First Transaction In A Block** ##### Coinbase Input: The Input Of The First Transaction In A Block {#coinbase}
{:.no_toc}
{% autocrossref %}
The first transaction in a block, called the coinbase transaction, must The first transaction in a block, called the coinbase transaction, must
have exactly one input, called a coinbase. The coinbase input currently have exactly one input, called a coinbase. The coinbase input currently

View file

@ -112,7 +112,7 @@ http://opensource.org/licenses/MIT.
[op_hash160]: /en/developer-reference#term-op-hash160 "Operation which converts the entry below it on the stack into a RIPEMD(SHA256()) hashed version of itself" [op_hash160]: /en/developer-reference#term-op-hash160 "Operation which converts the entry below it on the stack into a RIPEMD(SHA256()) hashed version of itself"
[op_return]: /en/developer-reference#term-op-return "Operation which terminates the script in failure" [op_return]: /en/developer-reference#term-op-return "Operation which terminates the script in failure"
[op_verify]: /en/developer-reference#term-op-verify "Operation which terminates the script if the entry below it on the stack is non-true (zero)" [op_verify]: /en/developer-reference#term-op-verify "Operation which terminates the script if the entry below it on the stack is non-true (zero)"
[outpoint]: /en/developer-reference#term-outpoint "The structure used to refer to a particular transaction output, consisting of a 32-byte TXID and a 4-byte output index number (vout)." [outpoint]: /en/developer-reference#outpoint "The structure used to refer to a particular transaction output, consisting of a 32-byte TXID and a 4-byte output index number (vout)."
[output]: /en/developer-guide#term-output "The output of a transaction which transfers value to a pubkey script" [output]: /en/developer-guide#term-output "The output of a transaction which transfers value to a pubkey script"
[output index]: /en/developer-guide#term-output-index "The sequentially-numbered index of outputs in a single transaction starting from 0" [output index]: /en/developer-guide#term-output-index "The sequentially-numbered index of outputs in a single transaction starting from 0"
[P2PKH]: /en/developer-guide#term-p2pkh "A pubkey script which Pays To PubKey Hashes (P2PKH), allowing spending of satoshis to anyone with a Bitcoin address" [P2PKH]: /en/developer-guide#term-p2pkh "A pubkey script which Pays To PubKey Hashes (P2PKH), allowing spending of satoshis to anyone with a Bitcoin address"
@ -258,7 +258,7 @@ http://opensource.org/licenses/MIT.
[rpc listunspent]: /en/developer-reference#listunspent [rpc listunspent]: /en/developer-reference#listunspent
[rpc lockunspent]: /en/developer-reference#lockunspent [rpc lockunspent]: /en/developer-reference#lockunspent
[rpc move]: /en/developer-reference#move [rpc move]: /en/developer-reference#move
[rpc ping]: /en/developer-reference#ping [rpc ping]: /en/developer-reference#ping-rpc
[rpc sendfrom]: /en/developer-reference#sendfrom [rpc sendfrom]: /en/developer-reference#sendfrom
[rpc sendmany]: /en/developer-reference#sendmany [rpc sendmany]: /en/developer-reference#sendmany
[rpc sendrawtransaction]: /en/developer-reference#sendrawtransaction [rpc sendrawtransaction]: /en/developer-reference#sendrawtransaction

View file

@ -833,7 +833,7 @@ table td,table th{
.anchorAf{ .anchorAf{
position:relative; position:relative;
} }
.anchorAf a{ .anchorAf a:first-child{
display:none; display:none;
position:absolute; position:absolute;
width:24px; width:24px;
@ -842,7 +842,7 @@ table td,table th{
top:0; top:0;
background:url(/img/icons/mini_ico_anchor.svg) no-repeat center center; background:url(/img/icons/mini_ico_anchor.svg) no-repeat center center;
} }
.anchorAf:hover a{ .anchorAf:hover a:first-child{
display:block; display:block;
} }

View file

@ -319,11 +319,14 @@ var setenv = function() {
first = [fallback, getTop(fallback)]; first = [fallback, getTop(fallback)];
last = [fallback, getTop(fallback)]; last = [fallback, getTop(fallback)];
closer = [fallback, getTop(fallback)]; closer = [fallback, getTop(fallback)];
// Find all titles. // Find all titles in toc.
var nodes = []; var nodes = [];
var tags = ['H2', 'H3', 'H4', 'H5', 'H6']; var tags = ['H2', 'H3', 'H4', 'H5', 'H6'];
for (var i = 0, n = tags.length; i < n; i++) { for (var i = 0, n = tags.length; i < n; i++) {
for (var ii = 0, t = document.getElementsByTagName(tags[i]), nn = t.length; ii < nn; ii++) nodes.push(t[ii]); for (var ii = 0, t = document.getElementsByTagName(tags[i]), nn = t.length; ii < nn; ii++) {
if (t[ii].className.indexOf('no_toc')!==-1) continue;
nodes.push(t[ii]);
}
} }
// Find first title, last title and closer title. // Find first title, last title and closer title.
for (var i = 0, n = nodes.length; i < n; i++) { for (var i = 0, n = nodes.length; i < n; i++) {
@ -408,7 +411,7 @@ for (var i = 0, n = tags.length; i < n; i++) {
} }
for (var i = 0, n = nodes.length; i < n; i++) { for (var i = 0, n = nodes.length; i < n; i++) {
if (!nodes[i].id) continue; if (!nodes[i].id) continue;
if (nodes[i].getElementsByTagName('A').length > 0) return; if (nodes[i].getElementsByTagName('A').length > 0 && nodes[i].getElementsByTagName('A')[0].innerHTML == '') return;
addClass(nodes[i], 'anchorAf'); addClass(nodes[i], 'anchorAf');
var anc = document.createElement('A'); var anc = document.createElement('A');
anc.href = '#' + nodes[i].id; anc.href = '#' + nodes[i].id;