我有一个第一个文件SWAP.rst,我需要提取一些特定的数据并放入字典中。
该文件如下所示:
:baseID: SWAP_DF
The current used for the force ...
.. requirement::SWAT_FD_AR_Force.432
:c_This_is_a: functional
:c_Release: AR_V2.RC
:c_Maturity: accepted
:c_Implementation: implemented
text text text text
tables
.. comment:: SDASD.471
:c_This_is_a: functional
:c_Release: adm_28.1
:c_Implementation: implemented
text tables etc
.. requirement:: SWAT_FD_AR_Force.231
:c_This_is_a: non-functional
:c_Release: AP_V1_RD1
:c_Maturity: accepted
:c_Implementation: implemented
text, tables ,etc我需要提取所有需求部分,并使用python、docutils放入字典中。
发布于 2021-11-17 15:55:55
您必须为comment和requirement指令执行implement Directive classes,以便可以将rst文档转换为文档树,然后再将其转换为所需的字典形式。
https://stackoverflow.com/questions/69986918
复制相似问题