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

Python recognized as Makefile #1976

Open
kernc opened this issue Feb 17, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@kernc
Copy link

commented Feb 17, 2019

(Originally reported in pdoc3/pdoc#32.)

The following <pre><code> is recognized as Makefile instead of Python (live example).

<!DOCTYPE html>
<html>
<head><meta charset="utf-8">
  
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.14.2/styles/default.min.css">
  <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.14.2/highlight.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script>
  
</head>
<body>

<pre><code>

#!python
import constraintanalysis as ca
import atmospheres as at
import unitconversions as co

designbrief = {'stloadfactor': 2, 'turnalt_m': 3050, 'turnspeed_ktas': 140}

etap = {'turn': 0.85}

designperformance = {'CLmaxclean': 1.45, 'CDminclean': 0.02541,
                     'etaprop': etap}

designdef = {'aspectratio': 10, 'sweep_le_deg': 2,
             'sweep_mt_deg': 0, 'bpr': -1}

TOW_kg = 1500

designatm = at.Atmosphere()
concept = ca.AircraftConcept(designbrief, designdef,
                             designperformance, designatm)

wingloading_pa = 1000

twreq, _, _ = concept.twrequired_trn(wingloading_pa)

turnspeed_mpstas = co.kts2mps(designbrief['turnspeed_ktas'])

pw_trn_wpn = ca.tw2pw(twreq, turnspeed_mpstas, etap['turn'])
pw_trn_hpkg = co.wn2hpkg(pw_trn_wpn)
p_trn_hp = pw_trn_hpkg * TOW_kg

print(p_trn_hp)

</code></pre>

  </body>
</html>

I believe hanging-indented lines containing spaces instead of tabs (\x09) should exclude Makefile altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.