Fix the markdown (I forgot)

by roundabout, Sunday, 31 March 2024, 17:28:53 (1711906133), pushed by roundabout, Wednesday, 31 July 2024, 06:54:43 (1722408883)

Author identity: vlad <vlad.muntoiu@gmail.com>

0f3ab7048c9643f015d73db44eb9aef044d074a1

markdown.py

@@ -446,73 +446,14 @@ def make_html(ast):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            if __name__ == '__main__':
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # Generate an AST from a markdown file
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            ast = tokenise(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    r"""
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        Changelog for version 0.1.0
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        ===========================
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        This is the first non-patch update to the project, still in άλφα state.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        New features in this release
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        ----------------------------
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        * Give each user a `.config` repo, which is used for storing settings, like
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          userstyles.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * Userstyles can be added to the `.config` repo under the name `theme.css`,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            and they will be applied to the UI.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * Efficient UI CSS variables can be overridden as well.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * The `.config` repo is created automatically when a user is created.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * The `.config` repo is private by default, but can be made public or
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            unlisted like any other.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * Right now, the `.config` repo is not used for anything else, but it will
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            be in the future.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * When repo deletion will be added, the `.config` will not be deletable.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * Currently, it is not possible for previous users to get a `.config` repo,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            but this will be added very soon.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        * Render markdown files, like this one, on file pages.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * Markdown comments are not yet rendered: that requires caching so loading
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            comments is not too slow.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * Markdown is rendered using a custom renderer, which is _not_ CommonMark
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            compliant.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * Some features are missing, but it supports extra features like ++diffs++ or
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            ~~strikethrough~~, and even *******7-star emphasis*******.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            * Missing features include:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              * Tables
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              * Footnotes
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              * Definition lists
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              * Task lists
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              * Indented code blocks
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              * Ordered lists (will be fixed with patch)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              * ID attributes
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              * Subscript and superscript
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              * Setext headers
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              * URL title attributes
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              * Backslash escaping for format specifiers
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              * HTML entities
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * Old features like trailing space hard breaks are not supported.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * No subset of HTML is rendered yet.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        Changed features in this release
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        --------------------------------
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        * Make the tab component styling look nicer.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * Colour now matches the nav tabs.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        Fixed bugs in this release
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        --------------------------
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        * The `safari-pinned-tab.svg` file now matches the updated logo.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * Before it matched a really similar development logo.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        * When accessing a nonexistent repository from the web interface, it now returns
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          a 404 error instead of a 403 error.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          * This was because the access control was done before the repository existence
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            check.
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        """
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # for i in ast:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            #     print(repr(i))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # Now convert the AST to HTML
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            print(make_html(ast).prettify(formatter=beautifulsoup.formatter.HTMLFormatter(indent=4)))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            with open("/home/vlad/roundabout/doc/changelog/0.1.0 (2024-03-31).md") as file:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                # Generate an AST from a markdown file
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                ast = tokenise(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    file.read()
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                # for i in ast:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                #     print(repr(i))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                # Now convert the AST to HTML
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                print(make_html(ast).prettify(formatter=beautifulsoup.formatter.HTMLFormatter(indent=4)))