Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #334 from 0xProject/docs/consolidateTSClientMd
Browse files Browse the repository at this point in the history
docs: Consolidate TS client Markdown docs into single file
  • Loading branch information
fabioberger authored Aug 6, 2019
2 parents 0ad75ac + 9343a84 commit b5b43df
Show file tree
Hide file tree
Showing 30 changed files with 1,678 additions and 1,340 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ examples/javascript_websocket_client/node_modules
examples/javascript_websocket_client/lib
rpc/clients/typescript/node_modules
rpc/clients/typescript/lib
rpc/clients/typescript/yarn-error.log
45 changes: 0 additions & 45 deletions cmd/cut-release/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"regexp"
"strings"
Expand Down Expand Up @@ -72,50 +71,6 @@ func generateTypescriptClientDocs() {
log.Print(string(stdoutStderr))
log.Fatal(err)
}

// Update SUMMARY.md
tsClientSummaryPath := "docs/json_rpc_clients/typescript/SUMMARY.md"
dat, err := ioutil.ReadFile(tsClientSummaryPath)
if err != nil {
log.Fatal(err)
}
// Modify the paths to be prefixed with `json_rpc_clients/typescript`
modifiedDat := strings.Replace(string(dat), "](", "](json_rpc_clients/typescript/", -1)
modifiedDat = strings.Replace(modifiedDat, "](json_rpc_clients/typescript/)", "]()", -1)
finalTsClientSummary := strings.Replace(modifiedDat, "* [", " * [", -1)

// Replace the summary content nested under `Typescript client`
mainSummaryPath := "docs/SUMMARY.md"
dat, err = ioutil.ReadFile(mainSummaryPath)
if err != nil {
log.Fatal(err)
}
finalSummaryLines := []string{}
lines := strings.Split(string(dat), "\n")
isCutting := false
for _, l := range lines {
if strings.Contains(l, "<!-- END TYPEDOC GENERATED SUMMARY -->") {
isCutting = false
finalSummaryLines = append(finalSummaryLines, finalTsClientSummary)
}
if !isCutting {
finalSummaryLines = append(finalSummaryLines, l)
}
if strings.Contains(l, "<!-- START TYPEDOC GENERATED SUMMARY -->") {
isCutting = true
}
}
finalSummary := strings.Join(finalSummaryLines, "\n")
err = ioutil.WriteFile(mainSummaryPath, []byte(finalSummary), 0644)
if err != nil {
log.Fatal(err)
}

// Remove the nested SUMMARY.MD file
err = os.Remove(tsClientSummaryPath)
if err != nil {
log.Fatal(err)
}
}

// Update the version string in all files that must be updated for a new release
Expand Down
51 changes: 1 addition & 50 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,56 +14,7 @@

* [Golang client](https://godoc.org/github.com/0xProject/0x-mesh/rpc)
* [TypeScript client](json_rpc_clients/typescript/README.md)
<!-- START TYPEDOC GENERATED SUMMARY -->
* [Globals](json_rpc_clients/typescript/globals.md)
* [External Modules]()
* [index](json_rpc_clients/typescript/modules/_index_.md)
* [types](json_rpc_clients/typescript/modules/_types_.md)
* [types.OrderEventKind](json_rpc_clients/typescript/enums/_types_.ordereventkind.md)
* [types.RejectedCode](json_rpc_clients/typescript/enums/_types_.rejectedcode.md)
* [types.RejectedKind](json_rpc_clients/typescript/enums/_types_.rejectedkind.md)
* [types.AcceptedOrderInfo](json_rpc_clients/typescript/interfaces/_types_.acceptedorderinfo.md)
* [types.ClientConfig](json_rpc_clients/typescript/interfaces/_types_.clientconfig.md)
* [types.GetOrdersResponse](json_rpc_clients/typescript/interfaces/_types_.getordersresponse.md)
* [types.HeartbeatEventPayload](json_rpc_clients/typescript/interfaces/_types_.heartbeateventpayload.md)
* [types.OrderEvent](json_rpc_clients/typescript/interfaces/_types_.orderevent.md)
* [types.OrderEventPayload](json_rpc_clients/typescript/interfaces/_types_.ordereventpayload.md)
* [types.RawAcceptedOrderInfo](json_rpc_clients/typescript/interfaces/_types_.rawacceptedorderinfo.md)
* [types.RawOrderEvent](json_rpc_clients/typescript/interfaces/_types_.raworderevent.md)
* [types.RawRejectedOrderInfo](json_rpc_clients/typescript/interfaces/_types_.rawrejectedorderinfo.md)
* [types.RawValidationResults](json_rpc_clients/typescript/interfaces/_types_.rawvalidationresults.md)
* [types.RejectedOrderInfo](json_rpc_clients/typescript/interfaces/_types_.rejectedorderinfo.md)
* [types.RejectedStatus](json_rpc_clients/typescript/interfaces/_types_.rejectedstatus.md)
* [types.StringifiedSignedOrder](json_rpc_clients/typescript/interfaces/_types_.stringifiedsignedorder.md)
* [types.ValidationResults](json_rpc_clients/typescript/interfaces/_types_.validationresults.md)
* [types.WSMessage](json_rpc_clients/typescript/interfaces/_types_.wsmessage.md)
* [types.WSOpts](json_rpc_clients/typescript/interfaces/_types_.wsopts.md)
* [ws_client](json_rpc_clients/typescript/modules/_ws_client_.md)
* [ws_client.WSClient](json_rpc_clients/typescript/classes/_ws_client_.wsclient.md)
* [Classes]()
* [ws_client.WSClient](json_rpc_clients/typescript/classes/_ws_client_.wsclient.md)
* [Enums]()
* [types.OrderEventKind](json_rpc_clients/typescript/enums/_types_.ordereventkind.md)
* [types.RejectedCode](json_rpc_clients/typescript/enums/_types_.rejectedcode.md)
* [types.RejectedKind](json_rpc_clients/typescript/enums/_types_.rejectedkind.md)
* [Interfaces]()
* [types.AcceptedOrderInfo](json_rpc_clients/typescript/interfaces/_types_.acceptedorderinfo.md)
* [types.ClientConfig](json_rpc_clients/typescript/interfaces/_types_.clientconfig.md)
* [types.GetOrdersResponse](json_rpc_clients/typescript/interfaces/_types_.getordersresponse.md)
* [types.HeartbeatEventPayload](json_rpc_clients/typescript/interfaces/_types_.heartbeateventpayload.md)
* [types.OrderEvent](json_rpc_clients/typescript/interfaces/_types_.orderevent.md)
* [types.OrderEventPayload](json_rpc_clients/typescript/interfaces/_types_.ordereventpayload.md)
* [types.RawAcceptedOrderInfo](json_rpc_clients/typescript/interfaces/_types_.rawacceptedorderinfo.md)
* [types.RawOrderEvent](json_rpc_clients/typescript/interfaces/_types_.raworderevent.md)
* [types.RawRejectedOrderInfo](json_rpc_clients/typescript/interfaces/_types_.rawrejectedorderinfo.md)
* [types.RawValidationResults](json_rpc_clients/typescript/interfaces/_types_.rawvalidationresults.md)
* [types.RejectedOrderInfo](json_rpc_clients/typescript/interfaces/_types_.rejectedorderinfo.md)
* [types.RejectedStatus](json_rpc_clients/typescript/interfaces/_types_.rejectedstatus.md)
* [types.StringifiedSignedOrder](json_rpc_clients/typescript/interfaces/_types_.stringifiedsignedorder.md)
* [types.ValidationResults](json_rpc_clients/typescript/interfaces/_types_.validationresults.md)
* [types.WSMessage](json_rpc_clients/typescript/interfaces/_types_.wsmessage.md)
* [types.WSOpts](json_rpc_clients/typescript/interfaces/_types_.wsopts.md)
<!-- END TYPEDOC GENERATED SUMMARY -->
* [Doc reference](json_rpc_clients/typescript/reference.md)

## Contributing

Expand Down
186 changes: 0 additions & 186 deletions docs/json_rpc_clients/typescript/classes/_ws_client_.wsclient.md

This file was deleted.

78 changes: 0 additions & 78 deletions docs/json_rpc_clients/typescript/enums/_types_.ordereventkind.md

This file was deleted.

Loading

0 comments on commit b5b43df

Please sign in to comment.