Skip to content

Commit

Permalink
Remove sys.path's from source link. Fixes googleapis#2046
Browse files Browse the repository at this point in the history
  • Loading branch information
daspecster committed Aug 3, 2016
1 parent 891e4a8 commit 1019102
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/generate_json_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import json
import os
import shutil
import sys
import types

import pdoc
Expand Down Expand Up @@ -295,11 +296,14 @@ def build_type(type_id, title, contents):


def clean_source_path(source):
source_path = ''

for path in sys.path:
source = source.replace(path, '')

if ABSOLUTE_LIBRARY_PATH in source:
source_path = source.replace(ABSOLUTE_LIBRARY_PATH, source)
source = source.replace(ABSOLUTE_LIBRARY_PATH, source)

return source_path
return source[1:]


def process_code_blocks(doc):
Expand Down

0 comments on commit 1019102

Please sign in to comment.