1 Star 0 Fork 0

Embedfire-stm32h7-pro/ebf_stm32h750_pro_v_hal_tutorial

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
latexbuild2.py 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
Yuhailong 提交于 2021-01-09 16:52 +08:00 . 修改了文档
# -*- coding: utf-8 -*-
import datetime, os, sys, shutil
name = "STM32 HAL库开发实战指南——基于H750_Pro_V"
#输出PDF文档 名称格式 type = 1:手册 type = 0:教程
type = 0
time = datetime.datetime.now().year * 10000 + datetime.datetime.now().month * 100 + datetime.datetime.now().day
if type == 1:
pdfname_time = '[野火] ' + name + str(time) + '.pdf'
pdfname = '[野火] ' + name + '.pdf'
else:
pdfname_time = '[野火EmbedFire]《' + name + '》—' + str(time) + '.pdf'
pdfname = '[野火EmbedFire]《' + name + '》' + '.pdf'
print(pdfname_time)
print(pdfname)
os.rename('_build/latex/output.pdf', '_build/latex/' + pdfname_time)
shutil.copy('_build/latex/' + pdfname_time, '_build/' + pdfname)
#-------------------------------------------------------------------------------#
old_str = ' <meta http-equiv="refresh" content="0; url=zh/latest/index.html" />\n'
f = open("_static/html/index.html", "r", encoding="utf-8")
line = f.readline()
f_new = open("_build/index.html", "w", encoding="utf-8")
while line:
if line == old_str:
line = ' <meta http-equiv="refresh" content="0; url=' + pdfname + '" />\n'
print("change line: ",line)
f_new.write(line)
line = f.readline()
f.close()
f_new.close()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Embedfire-stm32h7-pro/ebf_stm32h750_pro_v_hal_tutorial.git
git@gitee.com:Embedfire-stm32h7-pro/ebf_stm32h750_pro_v_hal_tutorial.git
Embedfire-stm32h7-pro
ebf_stm32h750_pro_v_hal_tutorial
ebf_stm32h750_pro_v_hal_tutorial
master

搜索帮助