Skip to content

Commit e179627

Browse files
authored
Merge pull request #3246 from masatake/rst--title
ReStructuredText: extract titles and subtitles
2 parents b4e2836 + ae9f095 commit e179627

File tree

22 files changed

+419
-57
lines changed

22 files changed

+419
-57
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#
22
# with --sort=yes
33
#
4-
A spaces B input_space.rst /^A spaces B$/;" c
4+
A spaces B input_space.rst /^A spaces B$/;" H
55
test input file.cc /^int32 test(int32 a)$/;" f typeref:typename:int32 signature:(int32 a)
66
test2 input file.cc /^int32 test2(void)$/;" f typeref:typename:int32 signature:(void)
77
test3 input file.cc /^int32 test3(int32 a)$/;" f typeref:typename:int32 signature:(int32 a)
88
test4 input file.cc /^int32 test4(int32$/;" f typeref:typename:int32 signature:(int32 a)
99
# WITH SCOPE
10-
X space Y input_scope.rst /^X space Y$/;" c
11-
title input_scope.rst /^title$/;" c
10+
X space Y input_scope.rst /^X space Y$/;" c title:title
11+
title input_scope.rst /^title$/;" H
1212
topic in space input_scope.rst /^topic in space$/;" s chapter:X space Y
1313
# WITHOUT SCOPE
1414
X space Y input_scope.rst /^X space Y$/;" c
15-
title input_scope.rst /^title$/;" c
15+
title input_scope.rst /^title$/;" H
1616
topic in space input_scope.rst /^topic in space$/;" s
1717
topic in tab input_scope.rst /^topic in tab$/;" s
1818
#
@@ -22,13 +22,13 @@ test input file.cc /^int32 test(int32 a)$/;" f typeref:typename:int32 signature:
2222
test2 input file.cc /^int32 test2(void)$/;" f typeref:typename:int32 signature:(void)
2323
test3 input file.cc /^int32 test3(int32 a)$/;" f typeref:typename:int32 signature:(int32 a)
2424
test4 input file.cc /^int32 test4(int32$/;" f typeref:typename:int32 signature:(int32 a)
25-
A spaces B input_space.rst /^A spaces B$/;" c
25+
A spaces B input_space.rst /^A spaces B$/;" H
2626
# WITH SCOPE
27-
title input_scope.rst /^title$/;" c
28-
X space Y input_scope.rst /^X space Y$/;" c
27+
title input_scope.rst /^title$/;" H
28+
X space Y input_scope.rst /^X space Y$/;" c title:title
2929
topic in space input_scope.rst /^topic in space$/;" s chapter:X space Y
3030
# WITHOUT SCOPE
31-
title input_scope.rst /^title$/;" c
31+
title input_scope.rst /^title$/;" H
3232
topic in tab input_scope.rst /^topic in tab$/;" s
3333
X space Y input_scope.rst /^X space Y$/;" c
3434
topic in space input_scope.rst /^topic in space$/;" s

Tmain/list-fields-with-prefix.d/stdout-expected.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ x UCTAGSxpath no NONE s-- no -- xpath for
3636
- UCTAGSnameref yes Python s-- no -- the original name for the tag
3737
- UCTAGSassignmentop no R s-- no -- operator for assignment
3838
- UCTAGSconstructor yes R s-- no -- function used for making value assigned to the nameattr tag
39+
- UCTAGSoverline no ReStructuredText --b no -- whether using overline & underline for declaring section
3940
- UCTAGSsectionMarker no ReStructuredText s-- no -- character used for declaring section
4041
- UCTAGSmixin yes Ruby s-- no -- how the class or module is mixed in (mixin:HOW:MODULE)
4142
- UCTAGSparameter no SystemVerilog --b no -- parameter whose value can be overridden.

Tmain/list-fields.d/stdout-expected.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ z kind no NONE s-- no r- [tags output] prepend "kind:" to k/ (or K/) field outpu
5454
- nameref yes Python s-- no -- the original name for the tag
5555
- assignmentop no R s-- no -- operator for assignment
5656
- constructor yes R s-- no -- function used for making value assigned to the nameattr tag
57+
- overline no ReStructuredText --b no -- whether using overline & underline for declaring section
5758
- sectionMarker no ReStructuredText s-- no -- character used for declaring section
5859
- mixin yes Ruby s-- no -- how the class or module is mixed in (mixin:HOW:MODULE)
5960
- parameter no SystemVerilog --b no -- parameter whose value can be overridden.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#LETTER NAME ENABLED LANGUAGE JSTYPE FIXED OP DESCRIPTION
2+
- overline no ReStructuredText --b no -- whether using overline & underline for declaring section
23
- sectionMarker no ReStructuredText s-- no -- character used for declaring section

Units/parser-html.r/class-and-id.d/expected.tags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Home &middot; Universal Ctags input.html /^ <\/title>$/;" j roles:def
12
/public/css/poole.css input.html /^<link rel="stylesheet" href="\/public\/css\/poole.css">$/;" C roles:extFile
23
/public/css/syntax.css input.html /^<link rel="stylesheet" href="\/public\/css\/syntax.css">$/;" C roles:extFile
34
/public/css/hyde.css input.html /^<link rel="stylesheet" href="\/public\/css\/hyde.css">$/;" C roles:extFile
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
--sort=no
2+
--fields-ReStructuredText=+{overline}{sectionMarker}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
KVM VCPU Requests input.rst /^KVM VCPU Requests$/;" c
2-
VCPU Request Internals input.rst /^VCPU Request Internals$/;" c
3-
References input.rst /^References$/;" c
1+
KVM VCPU Requests input.rst /^KVM VCPU Requests$/;" H sectionMarker:= overline:
2+
VCPU Request Internals input.rst /^VCPU Request Internals$/;" c title:KVM VCPU Requests sectionMarker:=
3+
References input.rst /^References$/;" c title:KVM VCPU Requests sectionMarker:=
44
atomic-ops input.rst /^.. [atomic-ops] Documentation\/core-api\/atomic_ops.rst$/;" C chapter:References
55
memory-barriers input.rst /^.. [memory-barriers] Documentation\/memory-barriers.txt$/;" C chapter:References
66
lwn-mb input.rst /^.. [lwn-mb] https:\/\/lwn.net\/Articles\/573436\/$/;" C chapter:References
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
Ch�pt�r 1 input.rst /^Ch�pt�r 1$/;" c
1+
Ch�pt�r 1 input.rst /^Ch�pt�r 1$/;" c subtitle:S�bit�tl�
22
Subsubsection 1.1.1.1 input.rst /^Subsubsection 1.1.1.1$/;" t subsection:S�bs
33
S��ti�n 1.1 input.rst /^S��ti�n 1.1$/;" s chapter:Ch�pt�r 1
44
S�bs input.rst /^S�bs$/;" S section:S��ti�n 1.1
5+
S�bit�tl� input.rst /^S�bit�tl�$/;" h title:T�tl�
6+
T�tl� input.rst /^T�tl�$/;" H

Units/parser-restructuredtext.r/iso8859-1-restructuredtext.d/input.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
=======================================
2+
Tîtlë
3+
=======================================
4+
---------------------------------------
5+
Sûbitïtlê
6+
---------------------------------------
7+
18
Chàptèr 1
29
=========
310

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
struct cpuidle_state input.rst /^.. |struct cpuidle_state| replace:: :c:type:`struct cpuidle_state <cpuidle_state>`$/;" d
22
cpufreq input.rst /^.. |cpufreq| replace:: :doc:`CPU Performance Scaling <cpufreq>`$/;" d
3-
CPU Idle Time Management input.rst /^CPU Idle Time Management$/;" c
3+
CPU Idle Time Management input.rst /^CPU Idle Time Management$/;" H

0 commit comments

Comments
 (0)