README - Status by section and wordcount

pull/224/head
Andreas M. Antonopoulos 4 years ago
parent 8ee334633f
commit 61be3679ca

@ -2,43 +2,55 @@
[![Build Status](https://travis-ci.com/lnbook/lnbook.svg?branch=develop)](https://travis-ci.com/lnbook/lnbook)
![Mastering Lightning Cover](images/cover_thumb.png)
<img src="images/cover_thumb.png" width=200 alt="Mastering Lightning Cover">
## About
Mastering the Lightning Network is an O'Reilly Media book, due for publication in Q4'2020, and announced on August 28th by authors Andreas M. Antonopoulos ([@aantonop](https://twitter.com/aantonop)), Olaoluwa Osuntokun ([@roasbeef](https://twitter.com/roasbeef)), Rene Pickhardt ([@renepickhardt](https://twitter.com/renepickhardt)).
The book describes the Lightning Network (LN), a Peer-to-Peer protocol running on top of Bitcoin and other blockchains, which provides near-instant, secure, micro-payments.
The book is suitable for technical readers with an understanding of the fundamentals of Bitcoin and other open blockchains.
# Status
## Status
The current status of the book is "IN PROGRESS". See below for status of specific chapters and read the contribution guide to learn how and where to contribute.
| Section | Wordcount | Status |
### Legend
* :arrows_clockwise: LIVE EDITS - Continuously changing: Submit focused/small Issues and PRs
* :mag: REVIEW - Ready for review: Submit Issues and PRs as needed
* :lock_with_ink_pen: EARLY DRAFT - In progress, changing often: Submit issues only, NO PRs or fixes
* :bookmark_tabs: OUTLINE - Rough outline - Please contribute! PRs welcome.
* :thought_balloon: PLANNED - Planned section - Do nothing yet.
| Section | Length (Word Count) | Status |
|-------|------|:------:|
| [Preface](preface.asciidoc) | # ||
| [Glossary](glossary.asciidoc) | # ||
| [Introduction](01_introduction.asciidoc) | # ||
| [Getting Started](02_getting_started.asciidoc) | # ||
| [LN Basics (How LN Works)](ch03.asciidoc) | # ||
| [Intro to LN Routing (HTLCs)](routing.asciidoc) | # ||
| [Nodes (LN Clients)](node_client.asciidoc) | # ||
| [Operating a Node](node_operations.asciidoc) | # ||
| [P2P Communication](p2p.asciidoc) | # ||
| [Channel Construction in Detail (Link Level Channel Operation)](channel-construction.asciidoc) | # ||
| [Onion Routing and HTLC forwarding](onion-routing-htlc-forwarding.asciidoc) | # ||
| [Channel Graph and Gossip Layer](channel-graph.asciidoc) | # ||
| [Payment Path Finding](path-finding.asciidoc) | # ||
| [End-to-End Payement Presentation Layer](e2e0presentation-layer.asciidoc) | # ||
| [Lightning Applications (LApps)]() | # ||
| [LN's Future]() | # ||
# Contributing
| [Preface and Acknowledgments](preface.asciidoc) | ### | :arrows_clockwise: |
| [Glossary](glossary.asciidoc) | ############# | :arrows_clockwise: |
| [Introduction](01_introduction.asciidoc) | ##### | :mag: |
| [Getting Started](02_getting_started.asciidoc) | ########## | :mag: |
| [LN Basics (How LN Works)](ch03.asciidoc) | #################### | :lock_with_ink_pen: |
| [Intro to LN Routing (HTLCs)](routing.asciidoc) | ########## | :lock_with_ink_pen: |
| [Nodes (LN Clients)](node_client.asciidoc) | #### | :lock_with_ink_pen: |
| [Operating a Node](node_operations.asciidoc) | # | :bookmark_tabs: |
| [P2P Communication](p2p.asciidoc) | # | :bookmark_tabs: |
| [Channel Construction in Detail](channel-construction.asciidoc) | # | :bookmark_tabs: |
| [Onion Routing and HTLC forwarding](onion-routing-htlc-forwarding.asciidoc) | # | :bookmark_tabs: |
| [Channel Graph and Gossip Layer](channel-graph.asciidoc) | # | :bookmark_tabs: |
| [Payment Path Finding](path-finding.asciidoc) | # | :bookmark_tabs: |
| [End-to-End Payement Presentation Layer](e2e-presentation-layer.asciidoc) | # | :bookmark_tabs: |
| [Lightning Applications (LApps)]() | # | :thought_balloon: |
| [LN's Future]() | # | :thought_balloon: |
Total Word Count: 33140
Target Word Count: 100,000-120,000
## Contributing
The authors welcome contributions to this book! Read the [Guide to Contributing](CONTRIBUTING.md)
# Source and license
## Source and license
Mastering the Lightning Network is released under the Creative Commons CC-BY-NC-ND license, which allows sharing the source code for personal use only. You may read this book for free. You may not create derivatives (such as PDF copies), or distribute the book commercially. The full terms of the license can be found here:

@ -0,0 +1,39 @@
from __future__ import print_function
import glob
import re
markup_files = glob.glob('*.asciidoc')
wordcount = {}
wordcount_sum = 0
for markup_file in markup_files:
markup_f = open(markup_file, 'r')
markup_contents = markup_f.read()
markup_f.close()
wc = len(markup_contents.strip().split())
wordcount_sum += wc
wordcount[markup_file] = wc
print(wc, "\t", markup_file)
print(wordcount_sum)
readme_f = open('README.md','r')
readme = readme_f.read()
readme_f.close()
wc_tag_re = re.compile("\| +(\[.*\])\((.*asciidoc)\) +\| +[\#]+ +\|(.*)$")
wc_total_re = re.compile("Total Word Count:")
readme_f = open('README.md','w')
for line in readme.splitlines():
match_re = wc_tag_re.match(line)
match_total = wc_total_re.match(line)
if match_re:
if match_re.group(2) in wordcount:
wordcount_bar = "#" * ((wordcount[match_re.group(2)]//500) + 1)
line = match_re.expand("| \g<1>(\g<2>) | " + wordcount_bar + " |\g<3>")
if match_total:
line = f"Total Word Count: {wordcount_sum}"
readme_f.write(line+"\n")
print(line)
readme_f.close()
Loading…
Cancel
Save