Deutsch English Français Italiano |
<mailman.49.1716851939.2909.python-list@python.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!fu-berlin.de!uni-berlin.de!not-for-mail From: Thomas Passin <list1@tompassin.net> Newsgroups: comp.lang.python Subject: Re: Weird Stuff (Markdown, syntax highlighting and Python) Date: Mon, 27 May 2024 14:08:55 -0400 Lines: 53 Message-ID: <mailman.49.1716851939.2909.python-list@python.org> References: <DEA4O.100038$m2s1.57313@fx04.ams4> <f398b7b6-b906-4027-8fac-0350b2222cf0@tompassin.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de T8ytK0i5eQmHPSuzxBk+swIq1juLUXQ24QPqIzkrE5Iw== Cancel-Lock: sha1:bgKZf/3BRTyAWK3zcbMV7gnCxN4= sha256:MktA9P5wCDGMS0POvs4Pmq5eWKBLUfhF8L7CKx8XUgw= Return-Path: <list1@tompassin.net> X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org Authentication-Results: mail.python.org; dkim=pass reason="2048-bit key; unprotected key" header.d=tompassin.net header.i=@tompassin.net header.b=YAxMDf/z; dkim-adsp=pass; dkim-atps=neutral X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'file?': 0.05; 'pages,': 0.09; 'python)': 0.09; 'received:23.83.212': 0.09; 'received:elm.relay.mailchannels.net': 0.09; 'url- ip:151.101.0.223/32': 0.09; 'url-ip:151.101.128.223/32': 0.09; 'url-ip:151.101.192.223/32': 0.09; 'url-ip:151.101.64.223/32': 0.09; 'subject:Python': 0.12; 'url:github': 0.14; 'import': 0.15; 'css': 0.16; 'default.': 0.16; 'markdown.': 0.16; 'received:10.0.0': 0.16; 'received:64.90': 0.16; 'received:64.90.62': 0.16; 'received:64.90.62.162': 0.16; 'received:dreamhost.com': 0.16; 'see?': 0.16; 'subject:syntax': 0.16; 'topic:': 0.16; 'url:project': 0.16; 'url:pypi': 0.16; 'wrote:': 0.16; 'python': 0.16; 'instead': 0.17; 'probably': 0.17; 'to:addr:python-list': 0.20; "i've": 0.22; 'code': 0.23; "i'd": 0.24; 'idea': 0.24; "isn't": 0.27; 'expect': 0.28; 'output': 0.28; 'header:User-Agent:1': 0.30; 'am,': 0.31; 'think': 0.32; 'anybody': 0.32; 'python-list': 0.32; 'received:10.0': 0.32; 'received:mailchannels.net': 0.32; 'received:relay.mailchannels.net': 0.32; 'but': 0.32; "i'm": 0.33; 'there': 0.33; 'mean': 0.34; 'work.': 0.34; 'header:In-Reply- To:1': 0.34; 'trying': 0.35; 'work,': 0.36; 'source': 0.36; 'currently': 0.37; 'using': 0.37; 'file': 0.38; 'read': 0.38; 'least': 0.39; 'otherwise': 0.39; 'block': 0.39; 'table': 0.39; 'case.': 0.40; 'should': 0.40; 'url-ip:151.101.0/24': 0.62; 'url- ip:151.101.128/24': 0.62; 'url-ip:151.101.192/24': 0.62; 'url- ip:151.101.64/24': 0.62; 'hours': 0.63; 'claims': 0.64; 'speaking': 0.64; 'spend': 0.64; 'day': 0.66; 'numbers': 0.67; 'header:Received:6': 0.67; 'received:64': 0.67; 'factor': 0.69; 'it:': 0.69; 'html': 0.80; 'coin': 0.84; 'flavors': 0.84; 'markdown': 0.84; 'minor': 0.84; 'subject:Weird': 0.84 X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1716833336; a=rsa-sha256; cv=none; b=UnYCWYWIoPl2XUs/l5rx1yXQ/d4xjDCrBaZZ0KpnuQkIzGa9G9sop3BKN3lPdoiPthaT6y mgdrJ5tKv7qktT4hXpDYK5sdcQ+joEzAQJo84wRvQ+5ZJfgVN+TkIES7cAnv7jAZghu7N+ zH6hhdj1kYxGyE/VgezlQn8YZ2qRjj+oZVKKfkOpYsedVC6rpyuctUeptyeTtNFY7oQC0d tOg5nNIjcq5YZPw5eqUWJKNF9KqdGikEXrUYeD6rah9tENrY/lG8+LTc9MTDL7Jg6dmYAa B2q2b6ahFE+cltBLGYnpVxT9mJiEQ89XTnNJaZwN7IEyuUErBL7Y2CrKlZVE3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1716833336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=s5lKJ6vO9q1k75ZhoT5zE6GGVkdrEKnf9MgajLz1l2o=; b=FpX4mVt3Yu0F/Rc9KiABgqhUZvcjax7YuA0eElpU7l1k4/ch5kfX66wvtUuf9fOSayFJux o8tboQYRSBZjdEpzAhngdwCiikVKmPFPN54B6jCy4UZy3hC8dcVvHu3cxbxTdbKqaS3K2h LNiAH4DGp7MAkjUfT3eAcrIvbMD/6wQe0fNnyRs52Li/uvgMzy+Rjtkk7b1a2IC2aQpklv mz1ZHZnHR2Ex8cqOG8QbrmkuXNDyxVDKoPQW43gfeG5HRI9JSIdwJ+B1hUWAdAghaTgdah 0ZxIdkHATVN6W9hBhB0rOkS3ybF+CyRXSx4fNsRgQgfpYJReZRJMzMRiCepwBg== ARC-Authentication-Results: i=1; rspamd-5d55749bb4-vpx52; auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|tpassin@tompassin.net X-MailChannels-Auth-Id: dreamhost X-Harbor-Quick: 4ebb8fd115486c08_1716833337168_3913245755 X-MC-Loop-Signature: 1716833337168:154878411 X-MC-Ingress-Time: 1716833337168 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net; s=dreamhost; t=1716833336; bh=s5lKJ6vO9q1k75ZhoT5zE6GGVkdrEKnf9MgajLz1l2o=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=YAxMDf/zuX6UGMhZgNAbT6tC220gawnj7aRUbB228BSvTJsLBeSDmZ3R9mYQRFDXz fqhUTk9ho+nzVNO9XlX3K3zycjfYASl8atUT0iLQ+r+XSrtvUtjPdZAOzI1DxyhJX8 STHEQgnu0ZQIQnOzRUi0yf4n7Z4eGbbaOJzhxqQ4T/qVx+TXBStW+PPN+AaXYgwOqM hMn2kpfN00lj8UDJwvggl8axidbgLXJS+k65zWXu6FL6wGAcoql7Q0vF7HH5uqHVwE B3x+LOWOiqLLVWiokCnqY6059SPRuvEE/lBRNSAj6X2EIefUZAB3/4S82SGV9oM0lE jOnsziQPf1Hzg== User-Agent: Mozilla Thunderbird Content-Language: en-US In-Reply-To: <DEA4O.100038$m2s1.57313@fx04.ams4> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: General discussion list for the Python programming language <python-list.python.org> List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> List-Archive: <https://mail.python.org/pipermail/python-list/> List-Post: <mailto:python-list@python.org> List-Help: <mailto:python-list-request@python.org?subject=help> List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> X-Mailman-Original-Message-ID: <f398b7b6-b906-4027-8fac-0350b2222cf0@tompassin.net> X-Mailman-Original-References: <DEA4O.100038$m2s1.57313@fx04.ams4> Bytes: 7827 On 5/26/2024 2:28 AM, Gilmeh Serda via Python-list wrote: > The web claims (I think on all pages I've read about Markdown and Python) > that this code should work, with some very minor variants on the topic: > > ```python > > import os > > with open(os.path.join('/home/user/apath', 'somefile')) as f: > print(f.read()) > ``` There are different flavors of Markdown, so that might be a factor so far as details of the block are concerned. What do you mean by it not "working"? What do you see and what did you expect to see? What did you see different when you used the next example? How did you generate the output HTML file? > However, that is not the case. At least not for me (using Python 3.12.3). > If instead I type it: > > #!python > > import os > > with open(os.path.join('/home/user/apath', 'somefile')) as f: > print(f.read()) > > As an indented block (four spaces) and a shebang, THEN it works. You even > get line numbers by default. > > N.b. if you don't know, you also need to generate a css file using > pygments to make this work. > > Not until I started to read the markdown source code and its docs pages, > the coin dropped. > > I'm posting this for other Markdown newbies that otherwise probably would > spend hours trying to make it work. > > > Speaking of Markdown. Does anybody out there have any idea how to turn on > table borders, adjust them (color/width/etc.) and such things? Currently I > have to add HTML to do so, which works, but isn't very nice. I'd hate to > spend an additional day or two, hunting for this info. > > References: > https://pypi.org/project/Markdown/ > https://python-markdown.github.io/ >