Skip to content

Commit

Permalink
docs: add readme's TOC
Browse files Browse the repository at this point in the history
  • Loading branch information
cyntler committed Jun 5, 2024
1 parent d575d30 commit 5d84929
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
42 changes: 37 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,45 @@

File viewer for **React v17+**.

> This is a fork of https://github.com/Alcumus/react-doc-viewer (inactivity for a long time)
> This is a fork of https://github.com/Alcumus/react-doc-viewer (inactivity for a long time).
## Important note!

> [!WARNING]
> This library uses the official MS Office online document viewing service. This means it works on an iframe basis and only supports public file URLs! Therefore, it may not be compatible with all projects. Currently, there is no way to natively render MS Office documents in the browser.
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents

- [Supported file types](#supported-file-types)
- [Storybook Demo](#storybook-demo)
- [Installation](#installation)
- [Usage](#usage)
- [Basic](#basic)
- [Initial Active Document](#initial-active-document)
- [Control over the displayed document](#control-over-the-displayed-document)
- [Displaying blob/uploaded documents](#displaying-blobuploaded-documents)
- [Included Renderers](#included-renderers)
- [Custom Renderer](#custom-renderer)
- [Custom File Loader](#custom-file-loader)
- [Theme](#theme)
- [Custom pre-fetch HTTP Verb](#custom-pre-fetch-http-verb)
- [Custom Request Headers](#custom-request-headers)
- [Internationalization (i18n)](#internationalization-i18n)
- [Styling](#styling)
- [CSS Class](#css-class)
- [CSS Class Default Override](#css-class-default-override)
- [React Inline](#react-inline)
- [Styled Components](#styled-components)
- [Using DocViewerRef](#using-docviewerref)
- [Config](#config)
- [Overriding Header Component](#overriding-header-component)
- [Overriding Loading Renderer](#overriding-loading-renderer)
- [Overriding No Renderer (Error)](#overriding-no-renderer-error)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Supported file types

| Extension | MIME Type |
Expand Down Expand Up @@ -295,13 +327,13 @@ The translations are based on the `.json` files that can be found in the `src/lo
Any styling applied to the `<DocViewer>` component, is directly applied to the main `div` container.
#### CSS Class
### CSS Class
```xml
<DocViewer documents={docs} className="my-doc-viewer-style" />
```
#### CSS Class Default Override
### CSS Class Default Override
Each component / div already has a DOM id that can be used to style any part of the document viewer.
Expand All @@ -311,13 +343,13 @@ Each component / div already has a DOM id that can be used to style any part of
}
```
#### React Inline
### React Inline
```xml
<DocViewer documents={docs} style={{ width: 500, height: 500 }} />
```
#### Styled Components
### Styled Components
```tsx
import styled from "styled-components";
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
"storybook:build": "rm -rf storybook-static && storybook build",
"deploy": "npm run storybook:build && gh-pages --nojekyll -d storybook-static --message 'feat: storybook deploy'",
"prerelease": "git checkout main && git pull && npm run prettier:check && npm run lint && npm run test && npm run build && cd use-cases/nextjs && npm i && npm run build",
"release": "release-it && npm run deploy"
"release": "release-it && npm run deploy",
"build-readme-toc": "npx doctoc README.md --title '## Table of Contents'",
"prepublish": "npm run build-readme-toc"
},
"dependencies": {
"@types/mustache": "^4.2.5",
Expand Down

0 comments on commit 5d84929

Please sign in to comment.