profile
viewpoint
Dan Lee dandhlee @GoogleCloudPlatform Canada Cloud DPE @GoogleCloudPlatform

googleapis/sphinx-docfx-yaml 2

Forked sphinx-docfx-yaml repository for creating DocFX YAML for Python Client Libraries

dandhlee/sphinx-docfx-yaml 0

Sphinx DocFX YAML is an exporter for the Sphinx Python domain into DocFX YAML format.

dandhlee/testrepo-githubapp 0

testing githubapp instead of github mirror

Pull request review commentgoogleapis/sphinx-docfx-yaml

feat: add syntax highlighting support for Markdown pages

 def extract_header_from_markdown(mdfile_iterator):     return mdfile_name  +# For a given markdown file, adds syntax highlighting to code blocks.+def highlight_md_codeblocks(mdfile):+    find_string = '```'+    find_string_nl = '```\n'+    replace_string = '```python'+    new_lines = []++    with open(mdfile) as mdfile_iterator:+        file_content = mdfile_iterator.read()+        # If there isn't even number of code block annotations do not syntax

Applied suggestion.

dandhlee

comment created time in 4 hours

Pull request review commentgoogleapis/sphinx-docfx-yaml

feat: add syntax highlighting support for Markdown pages

+```+test markdown file for+highlighing markdown codeblocks+```++```+all code blocks+should be highlighted+```

Done, added support for language indicators and unit test for it.

dandhlee

comment created time in 3 hours

Pull request review commentgoogleapis/sphinx-docfx-yaml

feat: add syntax highlighting support for Markdown pages

 def extract_header_from_markdown(mdfile_iterator):     return mdfile_name  +# For a given markdown file, adds syntax highlighting to code blocks.+def highlight_md_codeblocks(mdfile):+    find_string = '```'+    find_string_nl = '```\n'+    replace_string = '```python'

Thank you! Didn't know they were called fence 😅

dandhlee

comment created time in 4 hours

Pull request review commentgoogleapis/sphinx-docfx-yaml

feat: add syntax highlighting support for Markdown pages

 def extract_header_from_markdown(mdfile_iterator):     return mdfile_name  +# For a given markdown file, adds syntax highlighting to code blocks.+def highlight_md_codeblocks(mdfile):+    find_string = '```'+    find_string_nl = '```\n'+    replace_string = '```python'+    new_lines = []++    with open(mdfile) as mdfile_iterator:+        file_content = mdfile_iterator.read()+        # If there isn't even number of code block annotations do not syntax+        # highlight.+        if file_content.count(find_string_nl) % 2 != 0:+            print(f'{mdfile_iterator.name} contains mixed or wrong format of code blocks. Skipping syntax highlighting.')+            return+        # Retrieve code block positions to replace+        codeblocks = [[m.start(), m.end()] for m in re.finditer(+                                                      find_string,+                                                      file_content)]++        # This is equivalent to grabbing every odd index items.

Applied suggestion.

dandhlee

comment created time in 3 hours

Pull request review commentgoogleapis/sphinx-docfx-yaml

feat: add syntax highlighting support for Markdown pages

 def extract_header_from_markdown(mdfile_iterator):     return mdfile_name  +# For a given markdown file, adds syntax highlighting to code blocks.+def highlight_md_codeblocks(mdfile):+    find_string = '```'+    find_string_nl = '```\n'+    replace_string = '```python'+    new_lines = []++    with open(mdfile) as mdfile_iterator:+        file_content = mdfile_iterator.read()+        # If there isn't even number of code block annotations do not syntax+        # highlight.+        if file_content.count(find_string_nl) % 2 != 0:

For what I've seen throughout the libraries this never was the case, nonetheless I should ensure that this case is handled. At the moment we'd return without syntax highlighting applied in the file but this is also not going to work if there's exactly even number of language indicators which would cause chaos.

At the moment the easiest solution should be to check for language indicators' existence, and omit those pair of entries. I'll modify this code a bit to still check that there's an even number of fences.

dandhlee

comment created time in 4 hours

Pull request review commentgoogleapis/sphinx-docfx-yaml

feat: add syntax highlighting support for Markdown pages

+```+File with missing codeblock+```++```+with no closing bracket

Done.

dandhlee

comment created time in 3 hours

PullRequestReviewEvent
PullRequestReviewEvent

push eventgoogleapis/sphinx-docfx-yaml

Dan Lee

commit sha fcaea7069dd1ddd168e030a9b91f4d947a2ca8a8

fix: apply commit suggestion

view details

Dan Lee

commit sha 39fc824394b5e7d5b84b6b4c517020477dc5e0d9

feat: handle code blocks with langauge indicators

view details

Dan Lee

commit sha 442a2f7b168c90ffd38ddb63a968bd938a5520b9

test: update unittest with language indicator support

view details

push time in 3 hours

PR opened googleapis/sphinx-docfx-yaml

feat: add syntax highlighting support for Markdown pages

Markdown pages that are in rst format files come without any syntax highlighting support as they're omitted by the Sphinx markdown plugin. For all Markdown pages it is expected for none of the code blocks (whether specified to include a language or not), hence this feature will likely work well. In cases where there might be few that slip through the crack or are malformed, I've included an error check to ensure that we only process ones that seem valid.

Once python tag is added, actual syntax-highlight is taken care of by the code in doc-pipeline.

If this is added to a code block that's not Python code, prettyprint attempts to find a language based on the code provided and lang-python is just a supplement to help clarify that it might be Python code but will not add Python syntax highlight to Java code per se.

Fixes b/213152730.

  • [x] Tests pass
+105 -0

0 comment

6 changed files

pr created time in a day

push eventgoogleapis/sphinx-docfx-yaml

Dan Lee

commit sha 02c7180e8b169fb7245774200f7c733b2d5c9c6d

test: remove unneeded files

view details

push time in a day

create barnchgoogleapis/sphinx-docfx-yaml

branch : prettyprint_markdown

created branch time in a day

push eventrenovate-bot/getting-started-python

WhiteSource Renovate

commit sha 2ac94716f41967630f2c4ac2ec1e553fe2f640c2

chore(deps): update dependency google-cloud-storage to v2 (#421) * chore(deps): update dependency google-cloud-storage to v2 * chore(deps): pin to 2.0.0 Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com>

view details

Dan Lee

commit sha db4b1078d3865bc3f3f00b3e229467c3aeae42e0

Merge branch 'main' into renovate/requests-2.x

view details

push time in 2 days

PR closed GoogleCloudPlatform/getting-started-python

chore(deps): update dependency google-cloud-storage to v1.44.0

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
google-cloud-storage ==1.43.0 -> ==1.44.0 age adoption passing confidence

Release Notes

<details> <summary>googleapis/python-storage</summary>

v1.44.0

Compare Source

Features
Documentation
  • Describe code sample more specifically (#​660) (0459cb4)
  • refresh readme instructions (#​667) (ceb9314)
  • This is just a simple PR to better describe what the code is doing in the comments. (0459cb4)
  • use writeable streamin example for 'download_blob_to_file' (#​676) (96092d4)

</details>


Configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by WhiteSource Renovate. View repository job log here.

+1 -1

0 comment

1 changed file

renovate-bot

pr closed time in 2 days

push eventGoogleCloudPlatform/getting-started-python

WhiteSource Renovate

commit sha 2ac94716f41967630f2c4ac2ec1e553fe2f640c2

chore(deps): update dependency google-cloud-storage to v2 (#421) * chore(deps): update dependency google-cloud-storage to v2 * chore(deps): pin to 2.0.0 Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com>

view details

push time in 2 days

PR merged GoogleCloudPlatform/getting-started-python

chore(deps): update dependency google-cloud-storage to v2

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
google-cloud-storage ==1.43.0 -> ==2.1.0 age adoption passing confidence

Release Notes

<details> <summary>googleapis/python-storage</summary>

v2.1.0

Compare Source

Features

v2.0.0

Compare Source

⚠ BREAKING CHANGES
  • Remove Python 2 support (#​657)
Features

v1.44.0

Compare Source

Features
Documentation
  • Describe code sample more specifically (#​660) (0459cb4)
  • refresh readme instructions (#​667) (ceb9314)
  • This is just a simple PR to better describe what the code is doing in the comments. (0459cb4)
  • use writeable streamin example for 'download_blob_to_file' (#​676) (96092d4)

</details>


Configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by WhiteSource Renovate. View repository job log here.

+1 -1

0 comment

1 changed file

renovate-bot

pr closed time in 2 days

push eventrenovate-bot/getting-started-python

WhiteSource Renovate

commit sha 212ae7b1558c72291ad763cdd8df39ff4ef967ab

chore(deps): update dependency nox to v2022 (#420)

view details

Dan Lee

commit sha 48c8e6f251f64108da7ee0b005a079a069a42642

Merge branch 'main' into renovate/google-cloud-storage-1.x

view details

push time in 2 days

push eventrenovate-bot/getting-started-python

WhiteSource Renovate

commit sha 212ae7b1558c72291ad763cdd8df39ff4ef967ab

chore(deps): update dependency nox to v2022 (#420)

view details

Dan Lee

commit sha 6cf92abaf392e6507bae1bee0c02b0090b443a5d

Merge branch 'main' into renovate/cryptography-36.x

view details

push time in 2 days

push eventrenovate-bot/getting-started-python

WhiteSource Renovate

commit sha 212ae7b1558c72291ad763cdd8df39ff4ef967ab

chore(deps): update dependency nox to v2022 (#420)

view details

Dan Lee

commit sha e210f4ad20536698f26bf69573dcf64374a407b5

Merge branch 'main' into renovate/requests-2.x

view details

push time in 2 days

push eventrenovate-bot/getting-started-python

WhiteSource Renovate

commit sha 212ae7b1558c72291ad763cdd8df39ff4ef967ab

chore(deps): update dependency nox to v2022 (#420)

view details

Dan Lee

commit sha ec9523af35758d5bb6d786aa05dfda29cb7b0cd6

Merge branch 'main' into renovate/google-cloud-storage-2.x

view details

push time in 2 days

PullRequestReviewEvent

push eventGoogleCloudPlatform/getting-started-python

WhiteSource Renovate

commit sha 212ae7b1558c72291ad763cdd8df39ff4ef967ab

chore(deps): update dependency nox to v2022 (#420)

view details

push time in 2 days

PR merged GoogleCloudPlatform/getting-started-python

chore(deps): update dependency nox to v2022

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
nox (source) ==2021.10.1 -> ==2022.1.7 age adoption passing confidence

Release Notes

<details> <summary>theacodes/nox</summary>

v2022.1.7

Compare Source

Claudio Jolowicz, Diego Ramirez, and Tom Fleet have become maintainers of Nox. We'd like to thank the following folks who contributed to this release:

New features:

  • Add mamba backend (#​444, #​448, #​546, #​551)
  • Add session.debug to show debug-level messages (#​489)
  • Add cookbook page to the documentation (#​483)
  • Add support for the FORCE_COLOR environment variable (#​524, #​548)
  • Allow using session.chdir() as a context manager (#​543)
  • Deprecate use of session.install() without a valid backend (#​537)

Improvements:

  • Test against Python 3.10 (#​495, $502, #​506)
  • Add support for the channel option when using the conda backend (#​522)
  • Show more specific error message when the --keywords expression contains a syntax error (#​493)
  • Include reference to session.notify() in tutorial page (#​500)
  • Document how session.run() fails and how to handle failures (#​533)
  • Allow the list of sessions to be empty (#​523)

Bugfixes:

  • Fix broken temporary directory when using session.chdir() (#​555, #​556)
  • Set the CONDA_PREFIX environment variable (#​538)
  • Fix bin directory for the conda backend on Windows (#​535)

Internal changes:

  • Replace deprecated load_module with exec_module (#​498)
  • Include tests with source distributions (#​552)
  • Add missing copyright notices (#​509)
  • Use the new ReadTheDocs configurations (#​527)
  • Bump the Python version used by ReadTheDocs to 3.8 (#​496)
  • Improve the Sphinx config file (#​499)
  • Update all linter versions (#​528)
  • Add pre-commit and new checks (#​530, #​539)
  • Check MANIFEST.in during CI (#​552)
  • Remove redundant LICENSE from MANIFEST.in (#​505)
  • Make setuptools use the standard library's distutils to work around virtualenv bug. (#​547, #​549)
  • Use shlex.join() when logging a command (#​490)
  • Use shutil.rmtree() over shelling out to rm -rf in noxfile (#​519)
  • Fix missing Python 3.9 CI session (#​529)
  • Unpin docs session and add --error-on-missing-interpreter to CI (#​532)
  • Enable color output from Nox, pytest, and pre-commit during CI (#​542)
  • Only run conda_tests session by default if user has conda installed (#​521)
  • Update dependencies in requirements-conda-test.txt (#​536)

</details>


Configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by WhiteSource Renovate. View repository job log here.

+1 -1

0 comment

1 changed file

renovate-bot

pr closed time in 2 days

PullRequestReviewEvent

push eventrenovate-bot/getting-started-python

Dan Lee

commit sha c57be95a98f9a306cc275a363513ed859bfd6a54

chore(deps): pin to 2.0.0

view details

push time in 2 days

PullRequestReviewEvent

Pull request review commentGoogleCloudPlatform/getting-started-python

chore(deps): update dependency google-cloud-storage to v2

 Flask==2.0.2 google-cloud-firestore==2.3.4-google-cloud-storage==1.43.0+google-cloud-storage==2.1.0
google-cloud-storage==2.0.0
renovate-bot

comment created time in 2 days

push eventgoogleapis/sphinx-docfx-yaml

Dan Lee

commit sha 5ce356bb376492963b1eea2aff06ecb3ca2c9164

chore: fix repo-metadata as required (#169)

view details

push time in 2 days

delete branch googleapis/sphinx-docfx-yaml

delete branch : fix_metadata

delete time in 2 days

PR merged googleapis/sphinx-docfx-yaml

chore: fix repo-metadata as required
  • Added library_type: "OTHER"
  • Filled in client_documentation
  • Changed release_level to preview, although not sure if this needs to be stable

Fixes #164.

  • [x] Tests pass
+5 -3

0 comment

1 changed file

dandhlee

pr closed time in 2 days

more