Skip to content

Commit

Permalink
Doc: add TOC for FAQ
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer committed Dec 15, 2023
1 parent c866730 commit 7e891b7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ fix:
cargo fix --allow-staged

doc:
make -C openraft/src/docs/faq
RUSTDOCFLAGS="-D warnings" cargo doc --document-private-items --all --no-deps

check_missing_doc:
Expand Down
5 changes: 5 additions & 0 deletions openraft/src/docs/faq/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
all:
# dependency:
# https://github.com/jonschlinkert/markdown-toc#cli
# brew install markdown-toc
markdown-toc faq.md > faq-toc.md
9 changes: 9 additions & 0 deletions openraft/src/docs/faq/faq-toc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- [What are the differences between Openraft and standard Raft?](#what-are-the-differences-between-openraft-and-standard-raft)
- [Why is log id a tuple of `(term, node_id, log_index)`?](#why-is-log-id-a-tuple-of-term-node_id-log_index)
- [How to initialize a cluster?](#how-to-initialize-a-cluster)
- [Are there any issues with running a single node service?](#are-there-any-issues-with-running-a-single-node-service)
- [How to remove node-2 safely from a cluster `{1, 2, 3}`?](#how-to-remove-node-2-safely-from-a-cluster-1-2-3)
- [What actions are required when a node restarts?](#what-actions-are-required-when-a-node-restarts)
- [What will happen when data gets lost?](#what-will-happen-when-data-gets-lost)
- [Can I wipe out the data of ONE node and wait for the leader to replicate all data to it again?](#can-i-wipe-out-the-data-of-one-node-and-wait-for-the-leader-to-replicate-all-data-to-it-again)
- [Is Openraft resilient to incorrectly configured clusters?](#is-openraft-resilient-to-incorrectly-configured-clusters)
2 changes: 0 additions & 2 deletions openraft/src/docs/faq/faq.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# FAQ

### What are the differences between Openraft and standard Raft?

- Optionally, In one term there could be more than one leaders to be established, in order to reduce election conflict. See: std mode and adv mode leader id: [`leader_id`][];
Expand Down
3 changes: 3 additions & 0 deletions openraft/src/docs/faq/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
//! # FAQ
#![doc = include_str!("faq-toc.md")]

#![doc = include_str!("faq.md")]

0 comments on commit 7e891b7

Please sign in to comment.