New issue
Advanced search Search tips

Issue 598813 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature



Sign in to add a comment

Add script to launch md_browser against local file

Project Member Reported by jsb...@chromium.org, Mar 29 2016

Issue description

It would be nice if you could type:

md_browser my_doc_file.md

... and have md_browser launch, and then a browser window opened on the appropriate URL, saving time composing the URL.

 

Comment 1 by jsb...@chromium.org, Mar 29 2016

My fragile bash version:

#/usr/bin/env bash
file=$(readlink -f "$1")
if [ -z "$file" ]; then
    echo "fatal: Missing filename" 1>&2
    exit -1
fi

root=$(git rev-parse --show-toplevel 2> /dev/null)
if [ -z "$root" ]; then
    echo "fatal: Not a git repository" 1>&2
    exit -1
fi

relative="${file#$root}"

python -mwebbrowser "http://localhost:8080$relative" &
python $root/tools/md_browser/md_browser.py
wait

Cc: -dpranke@chromium.org no...@chromium.org
Labels: OS-All
Owner: dpranke@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/57ae508bce667f41d0e765004ac70f3c797d4e9f

commit 57ae508bce667f41d0e765004ac70f3c797d4e9f
Author: dpranke <dpranke@chromium.org>
Date: Tue Nov 08 00:38:49 2016

Add support for opening MD files directly in md_browser.

R=jsbell@chromium.org
BUG= 598813 

Review-Url: https://codereview.chromium.org/2476133002
Cr-Commit-Position: refs/heads/master@{#430445}

[modify] https://crrev.com/57ae508bce667f41d0e765004ac70f3c797d4e9f/tools/md_browser/md_browser.py

Comment 4 by jsb...@chromium.org, Nov 15 2016

Close this now?
Status: Fixed (was: Started)
Yup!

Sign in to add a comment