Page MenuHomePhabricator

Diffusion - re-jigger how README files get rendered
ClosedPublic

Authored by btrahan on Aug 22 2014, 9:45 PM.
Tags
None
Referenced Files
F14049669: D10340.id24894.diff
Thu, Nov 14, 2:09 PM
F14000650: D10340.id24893.diff
Thu, Oct 24, 11:25 PM
F13983860: D10340.id24894.diff
Oct 20 2024, 9:13 AM
F13970911: D10340.diff
Oct 17 2024, 10:28 AM
Unknown Object (File)
Oct 6 2024, 6:05 AM
Unknown Object (File)
Oct 6 2024, 12:52 AM
Unknown Object (File)
Oct 6 2024, 12:50 AM
Unknown Object (File)
Sep 27 2024, 4:34 AM

Details

Summary

be more aggressive about assuming plain-text, use remarkup for no extension, .remarkup, and .md, and last but not least use rainbow for .rainbow. Fixes T5818.

Test Plan

my README rendered just fine post these changes

Diff Detail

Repository
rP Phabricator
Branch
T5818
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 2335
Build 2339: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

btrahan retitled this revision from to Diffusion - re-jigger how README files get rendered.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Aug 22 2014, 9:56 PM
epriestley edited edge metadata.

Oh, hmm...

src/applications/diffusion/conduit/DiffusionReadmeQueryConduitAPIMethod.php
80–84

Oh -- do we get this wrong?

That is, if we have README.rst and also README.remarkup, is it possible we'd render one with the wrong rendering type?

This revision now requires changes to proceed.Aug 22 2014, 9:57 PM
src/applications/diffusion/conduit/DiffusionReadmeQueryConduitAPIMethod.php
81–83

That is, I'd expect we need something like:

$best_render_type = $render_type;

...here, and then to use $best_render_type below.

btrahan edited edge metadata.

nice catch, fixed

epriestley edited edge metadata.
This revision is now accepted and ready to land.Aug 22 2014, 10:09 PM
asherkin added inline comments.
src/applications/diffusion/conduit/DiffusionReadmeQueryConduitAPIMethod.php
49

This change doesn't seem correct? Files without an extension are generally going to be plain text - and appear to conflict with "be more aggressive about assuming plain-text".

Rendering actual plain text as remarkup is fine. It basically just gets links linked up, which is good.

It's only a problem when the text is formatted as something else and then we try to render it as remarkup and everything gets all terrible.

I'd be fine with rendering "README" (i.e., no extension) as plain text too, but not having links clickable seems slightly worse than what we generate from plaintext documents I've seen. If I'm wrong and some reasonable subset of no-extension files are actually terrible when rendered as remarkup we can/should change the rule to assume ".txt" from "README".

I'd be fine with rendering "README" (i.e., no extension) as plain text too, but not having links clickable seems slightly worse than what we generate from plaintext documents I've seen. If I'm wrong and some reasonable subset of no-extension files are actually terrible when rendered as remarkup we can/should change the rule to assume ".txt" from "README".

Na, doing it to linkify them makes complete sense.

btrahan updated this revision to Diff 24894.

Closed by commit rPc1e8d97069fa (authored by @btrahan).