-
Notifications
You must be signed in to change notification settings - Fork 507
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
Feature: optionally display line numbers in code blocks #799
Draft
snehankekre
wants to merge
1,922
commits into
main
Choose a base branch
from
feature/numbered
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Former-commit-id: e45e905
Former-commit-id: 371e6f5
Former-commit-id: bb2aac9
Former-commit-id: 254c7ee
Former-commit-id: 685f39f
Former-commit-id: dc79473
Explicitly mention that changes to config file while server is live requires restarting the server Former-commit-id: 1b4cecd
Former-commit-id: 310d1db
Former-commit-id: 1eac3d6
Add line breaks mid-word to API ref param names Former-commit-id: f02a1f0
Former-commit-id: 074ad92
Update blog posts on homepage Former-commit-id: 589f5f5
Former-commit-id: a814e2a
Former-commit-id: d692482
Former-commit-id: b4ee419
Former-commit-id: eaafb5c
Add docs for social share previews Former-commit-id: 8dc357f
Add theming docs for Plotly, Altair, and Vega-Lite Former-commit-id: c6446ff
Docs for colored text support Former-commit-id: 5c54443
Add docs for cached media element+form replay Former-commit-id: 777f458
* Add 1.16.0 release notes to changelog * Add the exception layout bug fix PR to changelog * Include PR numbers only in Other Changes * Update What's new tiles with latest features * Update blog posts on homepage * Bump version to 1.16.0 in cheat sheet and configuration * Bump version to 1.16.0 in embedded apps Former-commit-id: f7196eb
Former-commit-id: 9517e63
Former-commit-id: 1cd9350
Former-commit-id: be50775
Former-commit-id: 2e819d0
Former-commit-id: 6f77ee8
Former-commit-id: c669c90
Former-commit-id: 206a4df
Changed 'Thead' to 'Thread' This is my first pull request and I am beyond ecstatic. Former-commit-id: 363ba7b
Co-authored-by: snehankekre <[email protected]> Former-commit-id: 993872f
Co-authored-by: snehankekre <[email protected]> Former-commit-id: f5a357c
Corrects typo in the "Customize the menu" section. Attribute to set is `client.toolbarMode`. Former-commit-id: 7f80f14
Reflect most up-to-date usage. Former-commit-id: 20c442b
Removed reference to toast as a container for correctness. Former-commit-id: ee1f506
Add embedded app for LLM Tutorial: OpenAI, LangChain, and Streamlit in 18 lines of code Former-commit-id: f72d894
* Add tutorial embedded app Add embedded app for LLM Tutorial: OpenAI, LangChain, and Streamlit in 18 lines of code * Add LLM tutorial * Move emoji Emoji/grammar edit * Typesetting and style corrections Former-commit-id: bcaf474
Added a link to LLM quickstart Former-commit-id: 7ec811e
* Move pagination above helpful component * Update logic to override prev/next arrows * Make text larger * Improve color for border in dark mode Former-commit-id: fa81bc9
* Dont truncate floating nav * Add padding to prevent text to overflow Former-commit-id: 3c9087c
* Community Cloud sign-up and account instructions Updated Get started page to better describe the accounts used with Streamlit Community Cloud and how to sign up. * Wording clarity * Delete duplicate images This commit duplicate images in public/images/streamlit-cloud that were an artifact of renaming the folder to .../streamlit-community-cloud * Update sign-in instructions and images Update sign-in instructions and images for consistency * Update sign-in-email-3.png fix: URL mask alignment * Update Community Cloud Get started * Update images & move GitHub connection details More image updates for consistency and better resolution. GitHub connection details moved to a separate page. * Updated Community Cloud re:default URL Updated Community Cloud documentation to mention there is a pre-filled custom subdomain and that it can be deleted or changed. * Updated custom subdomain images Updated custom subdomain images for consistency and resolution. * Update app-dependencies.md Improve explanation of `requirements.txt` and `packages.txt` * Prettify Python package managers table Make table of Python package managers prettier. * Remove Workspace analytics * Edits for clarity Small edits for clarity and from feedback * Move connecting to GitHub Move Connect to GitHub out of Community Cloud Get started and make a separate page. * Delete duplicate Connect GitHub Delete duplicate content from temporary rearrangement. * Remove duplicate Connect to data sources index Removed duplicate index of Connect to data sources tutorials. * Rearrange folder structure in Community Cloud Move "Deploy your app", "Share your app", and "Manage your app" to the top level of navigation within Community Cloud. Move Trust and Security to Getting started alongs side connecting to GitHub/GitHub authorization. * Update Get started/Connect GitHub Updated instructions to connect to GitHub. Included explanation on authorizing organizations. * Add Community Cloud Quickstart * Added GItHub account management Added instructions for connecting and modifying GitHub account permissions after account creation. * Update links Update links from file rearrangement * Update Streamlit Community Cloud index.md Rearrange tiles on top-level page for Streamlit Community Cloud. * Split Get started in Community Cloud Move account creation and workspace exploration to their own sub-pages under Get started. * Update Community Cloud Quickstart Change to using the built-in sample app deployment from the New App menu instead of manually forking an example app to deploy. * Update account creation in Get started Additional images and edits to document the process of creating a Streamlit Community Cloud account. * Link updates and clarity edits Link updates and clarity edits within the pages of Get started in Community Cloud. * Edit for enterprise language Revise language in security-model.md * Update secrets management in Community Cloud * Update Share your app Move Manage your app to before Share your app. Update Share your app page including updating and adding images. * Update Embed your app * Update indexability.md * Update share-previews.md * Create app-analytics.md Modify description of app analytics and create separate page for it. Update and add images. * Create favorite-your-app.md Create separate page for app favoriting. Update and add images. * Create reboot-your-app.md Create separate page for rebooting apps. Update and add images. * Create delete-you-app.md Create separate page for deleting apps. Update and add images. * Update index.md for Manage your app Rearrange content to summarize the different places to access menus. Summarize each menu with links to the associated detail pages. Update and add images. * Create workspace-settings.md Create separate page for workspace settings as distinct from app settings. Update and add images. * Update links, images, and image descriptions Verify and update links and images from Get started through Manage your app/Workspace settings. * Update links, images, and image descriptions (Share your app) Verify and update links and images within Share your app section. * Remove localhost from link * Update links, images, and image descriptions (Manage your account section) Verify and update links and images within Manage your account section. * Small fixes and typos * Update main, Community Cloud page Change summary navigation at the top level of Streamlit Community Cloud. * Update links to Community Cloud section * Update header links to Streamlit Community Cloud section * Update redirects for Community Cloud Former-commit-id: 0f9b4cc
* Update generate.py Update generate.py to parse StatusContainer. * Update st.markdown example app * Add interactive markdown example * Add st.toggle embedded app source * Add embedded app source for chart color parameter * Switch to nightly for prerelease * Spacing/formatting in app source * Embedded app source formatting * Use type parameter in st.button example * Typesetting consistency * Revert st.button example app Moved change to release branch * Update title, header, subheader example apps * Add app source for st.status examples Former-commit-id: b2877f0
Former-commit-id: d775ce7
While working on e2e setup for component-template (streamlit/component-template#70) we extract example to separate file, so command for run example component is now invalid. Former-commit-id: f95d1fd
* Fix scrollbars for mac os * Remove console log statement Former-commit-id: 81fbcca
Former-commit-id: bd8e8a3
* Add documentation for `st.status` (#783) * Create st.status page * Update API cards & docstrings * Update st.status API card summary * Add st.status to chat elements in API index * Add st.toggle documentation (#784) * Add st.toggle documentation Add page, API card, and navigation for st.toggle * Update streamlit.json --------- Co-authored-by: snehankekre <[email protected]> * Feature/enable deploy button (#787) * Add deployment button gif * Move deploy button in app menu docs * Update image borders in app-menu.md * Sync streamlit.json with release branch --------- Co-authored-by: snehankekre <[email protected]> * Release 1.26 (#785) * Add captions and markdown to st.radio example * Update streamlit.json * Remove static images for title, header, subheader * Update markdown.md Add interactive embedded app * Update changelog for 1.26.0 * Update embedded apps to 1.26.0 * Use relative internal links in changelog for performance reasons * Fix Markdown issue in download button point * Move incorrect PR about number input into notable changes * Don't reference PR 7154 in other changes * Change impact label and add PR 7143 to other changes * Update cheatsheet and configuration.md * Update What's new --------- Co-authored-by: snehankekre <[email protected]> * Update streamlit.json (#790) * Update streamlit.json * Update widget.button.py --------- Co-authored-by: snehankekre <[email protected]> Former-commit-id: 2abd435
Co-authored-by: snehankekre <[email protected]> Former-commit-id: ad5319a
Former-commit-id: 64d2717
Former-commit-id: 2342c86
Former-commit-id: 9d47cd1
Former-commit-id: ffeca19
b3556df
to
0f7acc8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📚 Context
The docs can sometimes contain long code blocks. Authors may want to reference specific lines of the code block in preceding or subsequent paragraph text. Doing so without displayed line numbers can be challenging. To that end, this PR introduces a feature to optionally include line numbers in code blocks using the prism line numbers plugin. There are two ways to do:
showLineNumbers
to the right of ```python. E.g.<Code>
component, set the propshowLineNumbers={true}
. E.g.Since we use code blocks in many places in our docs, and some places where we might not want line numbers (API cards), line numbers are turned off by default.
🧠 Description of Changes
showLineNumbers
prop to code.js that, if set by the author, shows line numbers in the<pre>
preceding the<code>
styles/text.scss
to hide the vertical border to the right of line numbersRevised:
Current:
💥 Impact
Size:
🌐 References
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.