Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)N
Posts
0
Comments
1043
Joined
2 yr. ago

  • im regularly cooking lentils with beef/chicken, eggs and vegetables

  • it's extremely good and it has every feature that it needs.

    it comes from the era of the internet that developed communication protocols instead of proprietary for-profit software applications running on an electron gui or whatever.

  • wouldn't they then just modify and drive some type of skinny tire electric bike?

  • run out of money and then die. that's my plan

  • put anything you want into a rice cooker and that's it

  • yes. everyone is inside because it's hot, and everyone is getting drunk because that's the only thing there is to do, and everyone is driving a car because that's the only way to get there. if you didn't drive, then you're waiting around for the person who drove you, and you're getting really drunk because they don't want to leave yet. what a stupid ironic life

  • explain

  • The Doom loop is actually more to do with architecture that is not designed with hot temperatures in mind, because it's assumed that central air conditioning will be used.

  • sorry I don't know what any of these things are

  • it kind of sucks living in a part of the world that requires you to sit in air conditioned bubbles all day. it's a fucking depressing way to live.

  • The machine also traps water vapor, and uses electrolysis to break water down into hydrogen and oxygen instead of destroying your car's cooling system.

    what the fuck does this even mean

  • also don't do this because fuck that

  • WHAT

  • I could not get pandoc to work on my system. after a few attempts going in circles with dependency packages, I gave up

  • i don't care about the lemmy.ml drama because im not on there

  • you could try protesting and getting shot by cops

  • live streaming from a phone is very practical. I don't think I'd be flying a drone around

  • if you want to be really super sure then you live stream the video. That's how it was done at occupy.

  • I am composing my resume with markdown and then using a python script to produce a PDF. The result is vertical and clean and machine readable:

     
        
    #!/usr/bin/env python3
    """Convert Markdown files to PDF."""
    
    import argparse
    import sys
    from pathlib import Path
    
    try:
        import markdown
        from weasyprint import HTML, CSS
    except ImportError:
        print("Missing dependencies. Install with:")
        print("  pip install markdown weasyprint")
        sys.exit(1)
    
    
    CSS_STYLES = """
    @page {
        margin: 0.5in 0.6in;
        size: letter;
    }
    body {
        font-family: "Courier New", Courier, "Liberation Mono", monospace;
        font-size: 10pt;
        line-height: 1.4;
        color: #222;
        max-width: 100%;
    }
    h1, h2, h3 {
        margin-top: 1em;
        margin-bottom: 0.3em;
        padding-bottom: 0.2em;
    }
    h1 { font-size: 16pt; }
    h2 { font-size: 13pt; }
    h3 { font-size: 11pt; }
    h4 { font-size: 10pt; font-weight: normal; margin-bottom: 0.5em;}
    ul {
        margin: 0.3em 0;
        padding-left: 1.2em;
    }
    li {
        margin-bottom: 0.2em;
    }
    p {
        margin: 0.4em 0;
    }
    p + p {
        margin-top: 0.2em;
    }
    strong {
        font-weight: bold;
    }
    """
    
    
    PAGE_BREAK_MARKER = "<!-- pagebreak -->"
    PAGE_BREAK_HTML = '<div style="page-break-before: always;"></div>'
    
    
    def process_page_breaks(html_content: str) -> str:
        """Replace page break markers with actual page break HTML."""
        return html_content.replace(PAGE_BREAK_MARKER, PAGE_BREAK_HTML)
    
    
    def md_to_html(input_path: Path) -> str:
        """Convert a Markdown file to HTML content."""
        md_content = input_path.read_text(encoding="utf-8")
        html_content = markdown.markdown(md_content)
        return process_page_breaks(html_content)
    
    
    def convert_md_to_pdf(input_paths: list[Path], output_path: Path) -> None:
        """Convert one or more Markdown files to a single PDF."""
        html_parts = []
        for i, input_path in enumerate(input_paths):
            if i > 0:
                html_parts.append(PAGE_BREAK_HTML)
            html_parts.append(md_to_html(input_path))
    
        full_html = f"""
        <!DOCTYPE html>
        <html>
        <head><meta charset="utf-8"></head>
        <body>{"".join(html_parts)}</body>
        </html>
        """
    
        HTML(string=full_html).write_pdf(output_path, stylesheets=[CSS(string=CSS_STYLES)])
        print(f"Created: {output_path}")
    
    
    def main():
        parser = argparse.ArgumentParser(description="Convert Markdown files to PDF")
        parser.add_argument("files", nargs="*", type=Path, help="Markdown files to convert")
        parser.add_argument("-o", "--output", type=Path, help="Output PDF path")
        parser.add_argument("-m", "--merge", action="store_true", help="Merge all input files into a single PDF")
        args = parser.parse_args()
    
        # Default to all .md files in current directory
        files = args.files if args.files else list(Path(".").glob("*.md"))
    
        if not files:
            print("No Markdown files found")
            sys.exit(1)
    
        if args.merge:
            if not args.output:
                print("Error: --output is required when using --merge")
                sys.exit(1)
            for md_file in files:
                if not md_file.exists():
                    print(f"File not found: {md_file}")
                    sys.exit(1)
            convert_md_to_pdf(files, args.output)
        else:
            if args.output and len(files) > 1:
                print("Error: --output can only be used with a single input file (or use --merge)")
                sys.exit(1)
    
            for md_file in files:
                if not md_file.exists():
                    print(f"File not found: {md_file}")
                    continue
                output_path = args.output if args.output else md_file.with_suffix(".pdf")
                convert_md_to_pdf([md_file], output_path)
    
    
    if __name__ == "__main__":
        main()