Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如果构建使用的 Markdown 无 # 标签时将产生报错 #7

Closed
JingHai-Lingyun opened this issue Feb 28, 2024 · 2 comments
Closed

Comments

@JingHai-Lingyun
Copy link
Contributor

Example

## EXAMPLE

* Hello World!
* Bonjour Le Monde!
* Ciao Mondo!

Error Log

(.venv) D:\PCL-HomepageBuilder>python main.py -o ./1MainFiles/Project.yml -w ./dist/Custom.xaml
[INFO][Project] Initing ...
[INFO][Project] Loading basic resources
[INFO][Resource] Loading resource pack: D:\PCL-HomepageBuilder\Resources
[INFO][Project] Loading plugins
[INFO][Resource] Loading resource pack: D:\PCL-HomepageBuilder\Plugin\Markdown\Resources
[INFO][Project] Start to import pack at: ./1MainFiles/Project.yml
[INFO][Project] Pack version: 0.9.0
[INFO][Project] Loading cards
[INFO][Library] Loading library: rootLibrary
[INFO][Project] Importing resources
[INFO][Resource] Loading resource pack: ./1MainFiles\Resources
[INFO][Project] Loading pages
[INFO][Project] Pack loaded successful!
[INFO][Project] Getting codes of page: DefaultPage
[INFO][Project] Get card: ['HelloWorld']
[WARNING][TemplateManager] 构建卡片时出现错误:
Traceback (most recent call last):
  File "D:\PCL-HomepageBuilder\Core\Templates_Manager.py", line 98, in try_build
    return self.build_with_template(card,template,'')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\PCL-HomepageBuilder\Core\Templates_Manager.py", line 55, in build_with_template
    card = self.expend_card_placeholders(card,children_code)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\PCL-HomepageBuilder\Core\Templates_Manager.py", line 40, in expend_card_placeholders
    card[key] = format_code(str(card[key]),card,self.resources,children_code)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\PCL-HomepageBuilder\Core\Code_Formatter.py", line 18, in format_code
    replacement = runScript(qurey_tuple[0][1:],resources,card,qurey_tuple,children_code)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\PCL-HomepageBuilder\Core\Code_Formatter.py", line 48, in runScript
    result = str(script(card,args,resources))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 9, in script
IndexError: list index out of range
Skipped.
@Light-Beacon
Copy link
Owner

MarkdownCard 模版 需要提供一级标题以提供卡片标题

@JingHai-Lingyun
Copy link
Contributor Author

JingHai-Lingyun commented Feb 29, 2024

有些卡片可以不要标题,然后做默认展开,这种情况下好像就不好处理了?
e.g. Hex-Dragon/PCL2#2528 (reply in thread)
或者是用类似 Hex-Dragon/PCL2#2528 (comment) 右上方卡片中那个分块的带横线标题做自定义 Title

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants