Git Product home page Git Product logo

Comments (2)

 avatar commented on August 15, 2024
            # 标题
            elif 'heading' in child.tag:
                level = child.attrib['level']
                if level == 'a' or level == 'b':
                    level = 1
                for child2 in child:
                    if 'text' in child2.tag:
                        # 将 None 转为 "
                        if child2.text is None:
                            child2.text = ''
                        else:
                            new_content += f'%s ' % ("#" * int(level))
                        new_content += f'%s{nl}{nl}' % child2.text
                        break

from youdaonote-pull.

 avatar commented on August 15, 2024

转换有道云目录的

 catalogue = False # 目录 catalogue 只替换一次 替换成功后 变成 True
        for child in root[1]:
            # 正常文本
            if 'para' in child.tag:
             .....

            # 目录 catalogue 只替换一次
            elif 'catalogue' in child.tag:
                if catalogue == False :
                    new_content += f'[toc]{nl}{nl}'
                catalogue = True

from youdaonote-pull.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.