Skip to content

Commit c1c07a2

Browse files
committed
xref wip
1 parent bac360a commit c1c07a2

File tree

2 files changed

+78
-1
lines changed

2 files changed

+78
-1
lines changed

links/FPY.LI.htaccess

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,3 +1172,36 @@ RedirectTemp /4k https://github.com/pythonfluente/pythonfluente2e
11721172
RedirectTemp /4m https://github.com/pythonfluente/pythonfluente2e/issues
11731173
RedirectTemp /4n https://www.thoughtworks.com/pt-br
11741174
RedirectTemp /4p https://asciidoctor.org/
1175+
1176+
# appended 2025-08-31 22:14:23
1177+
RedirectTemp /4q https://pythonfluente.com/2/#ch_ifaces_prot_abc
1178+
RedirectTemp /4r https://pythonfluente.com/2/#ch_op_overload
1179+
RedirectTemp /4s https://pythonfluente.com/2/#ch_generators
1180+
RedirectTemp /4t https://pythonfluente.com/2/#ch_seq_methods
1181+
RedirectTemp /4v https://pythonfluente.com/2/#classes_protocols_part
1182+
RedirectTemp /4w https://pythonfluente.com/2/#how_slicing_works_sec
1183+
RedirectTemp /4x https://pythonfluente.com/2/#sliceable_sequence_sec
1184+
RedirectTemp /4y https://pythonfluente.com/2/#lispy_environ_sec
1185+
RedirectTemp /4z https://pythonfluente.com/2/#subclass_builtin_woes_sec
1186+
RedirectTemp /52 https://pythonfluente.com/2/#slots_sec
1187+
RedirectTemp /53 https://pythonfluente.com/2/#ch_class_metaprog
1188+
RedirectTemp /54 https://pythonfluente.com/2/#ch_more_types
1189+
RedirectTemp /55 https://pythonfluente.com/2/#ch_descriptors
1190+
RedirectTemp /56 https://pythonfluente.com/2/#ch_inheritance
1191+
RedirectTemp /57 https://pythonfluente.com/2/#ch_async
1192+
RedirectTemp /58 https://pythonfluente.com/2/#runtime_annot_sec
1193+
RedirectTemp /59 https://pythonfluente.com/2/#multi_hashing_sec
1194+
RedirectTemp /5a https://pythonfluente.com/2/#iterable_reducing_sec
1195+
RedirectTemp /5b https://pythonfluente.com/2/#flexible_new_sec
1196+
RedirectTemp /5c https://pythonfluente.com/2/#ch_closure_decorator
1197+
RedirectTemp /5d https://pythonfluente.com/2/#ch_design_patterns
1198+
RedirectTemp /5e https://pythonfluente.com/2/#lispy_parser_sec
1199+
RedirectTemp /5f https://pythonfluente.com/2/#overload_sec
1200+
RedirectTemp /5g https://pythonfluente.com/2/#numbers_abc_proto_sec
1201+
RedirectTemp /5h https://pythonfluente.com/2/#runtime_checkable_proto_sec
1202+
RedirectTemp /5j https://pythonfluente.com/2/#variance_sec
1203+
RedirectTemp /5k https://pythonfluente.com/2/#generic_iterable_types_sec
1204+
RedirectTemp /5m https://pythonfluente.com/2/#typed_double_sec
1205+
RedirectTemp /5n https://pythonfluente.com/2/#enhancing_with_init_subclass_sec
1206+
RedirectTemp /5p https://pythonfluente.com/2/#more_type_hints_further_sec
1207+
RedirectTemp /5q https://pythonfluente.com/2/#max_overload_sec

print/xrefs/xvol_xrefs.py

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,49 @@ def section_numbers(sec_title: str):
9898
'metaprog_part': 'V—Metaprogramação',
9999
}
100100

101+
SHORTENER_OUTPUT = '''
102+
+ /4q https://pythonfluente.com/2/#ch_ifaces_prot_abc
103+
+ /4r https://pythonfluente.com/2/#ch_op_overload
104+
+ /4s https://pythonfluente.com/2/#ch_generators
105+
+ /4t https://pythonfluente.com/2/#ch_seq_methods
106+
= /22 https://pythonfluente.com/2/#pattern_matching_case_study_sec
107+
+ /4v https://pythonfluente.com/2/#classes_protocols_part
108+
+ /4w https://pythonfluente.com/2/#how_slicing_works_sec
109+
+ /4x https://pythonfluente.com/2/#sliceable_sequence_sec
110+
= /25 https://pythonfluente.com/2/#virtual_subclass_sec
111+
+ /4y https://pythonfluente.com/2/#lispy_environ_sec
112+
+ /4z https://pythonfluente.com/2/#subclass_builtin_woes_sec
113+
+ /52 https://pythonfluente.com/2/#slots_sec
114+
= /29 https://pythonfluente.com/2/#typeddict_sec
115+
+ /53 https://pythonfluente.com/2/#ch_class_metaprog
116+
= /2a https://pythonfluente.com/2/#problems_annot_runtime_sec
117+
+ /54 https://pythonfluente.com/2/#ch_more_types
118+
+ /55 https://pythonfluente.com/2/#ch_descriptors
119+
+ /56 https://pythonfluente.com/2/#ch_inheritance
120+
= /2c https://pythonfluente.com/2/#positional_pattern_implement_sec
121+
+ /57 https://pythonfluente.com/2/#ch_async
122+
+ /58 https://pythonfluente.com/2/#runtime_annot_sec
123+
+ /59 https://pythonfluente.com/2/#multi_hashing_sec
124+
+ /5a https://pythonfluente.com/2/#iterable_reducing_sec
125+
+ /5b https://pythonfluente.com/2/#flexible_new_sec
126+
+ /5c https://pythonfluente.com/2/#ch_closure_decorator
127+
+ /5d https://pythonfluente.com/2/#ch_design_patterns
128+
+ /5e https://pythonfluente.com/2/#lispy_parser_sec
129+
+ /5f https://pythonfluente.com/2/#overload_sec
130+
+ /5g https://pythonfluente.com/2/#numbers_abc_proto_sec
131+
+ /5h https://pythonfluente.com/2/#runtime_checkable_proto_sec
132+
+ /5j https://pythonfluente.com/2/#variance_sec
133+
+ /5k https://pythonfluente.com/2/#generic_iterable_types_sec
134+
+ /5m https://pythonfluente.com/2/#typed_double_sec
135+
+ /5n https://pythonfluente.com/2/#enhancing_with_init_subclass_sec
136+
+ /5p https://pythonfluente.com/2/#more_type_hints_further_sec
137+
+ /5q https://pythonfluente.com/2/#max_overload_sec
138+
'''
139+
140+
SHORT_URLS = {line.split()[2]:line.split()[1] for line
141+
in SHORTENER_OUTPUT.strip().split('\n')}
142+
143+
101144
def replace_xrefs_to_vols():
102145
html_path = find_git_root() / 'online/index.html'
103146
with open(html_path) as fp:
@@ -121,7 +164,8 @@ def replace_xrefs_to_vols():
121164
else:
122165
raise ValueError(f'unexpected xref: {xref!r}')
123166
link = BASE_URL + '#' + xref
124-
print(f'<<{xref}>>', f'{text} [vol.{volume}, {link}]')
167+
print(f'<<{xref}>>', f'{text} [vol.{volume}, fpy.li{SHORT_URLS[link]}]')
168+
125169

126170
if __name__ == '__main__':
127171
replace_xrefs_to_vols()

0 commit comments

Comments
 (0)