GithubHelp home page GithubHelp logo

corob-msft / cleanrepo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gewarren/cleanrepo

0.0 1.0 0.0 16.92 MB

Tool that finds markdown (.md) files that aren't listed in any TOC file - and much more!

C# 100.00%

cleanrepo's Introduction

CleanRepo

This command-line tool helps you clean up a DocFx-based content repo. It can:

  • Find and delete markdown files that aren't linked from a TOC file.
  • Find and delete orphaned image (.png, .jpg, .gif, .svg) files.
  • Map images to the files that reference them.
  • Find and delete orphaned "shared" markdown files (includes).
  • Find and replace links to redirected files.
  • Replace site-relative links with file-relative links (includes image links).

Usage

Command Description
--orphaned-topics Use this option to find orphaned articles.
--orphaned-images Find orphaned .png, .gif, .svg, or .jpg files.
Note: The tool does not know if images are referenced in a code sample project, so we recommend not running this option on a directory that contains samples.
--orphaned-snippets Find orphaned .cs and .vb files.
--orphaned-includes Find orphaned INCLUDE files.
--catalog-images Map images to the markdown/YAML files that reference them. This option generates a JSON file with the output.
--format-redirects Format the redirection JSON file by deserializing and then serializing with pretty printing.
--replace-redirects Find backlinks to redirected files and replace with new target.
--relative-links Replace site-relative links with file-relative links. You must also specify the docset name for the repo.

Usage examples

  • Find orphaned articles recursively (that is, in the specified directory and any subdirectories):

    CleanRepo.exe --orphaned-topics
    

    The tool will prompt you for any additional information it needs for that function, for example, the directory to look in. However, you can also pass that option in with the initial command.

    CleanRepo.exe --orphaned-topics --start-directory c:\repos\visualstudio-docs-pr\docs\ide
    
  • Find and delete orphaned .png/.gif/.jpg/.svg files:

    CleanRepo.exe --orphaned-images
    

cleanrepo's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.