@@ -47,6 +47,93 @@ Example badges for `mio` crate:
47
47
| Version 0.1.0: < https://docs.rs/mio/badge.svg?version=0.1.0 > | ![ mio] ( https://docs.rs/mio/badge.svg?version=0.1.0 ) |
48
48
49
49
50
+ ## Development
51
+
52
+ We strongly recommend using vagrant, this will give you a virtual machine
53
+ already configured and ready to start developing on.
54
+
55
+ ### Getting started
56
+
57
+ Make sure you have vagrant, virtualbox and a ssh client and you need
58
+ to able to download ~ 800MB data on the first run.
59
+
60
+
61
+ ``` sh
62
+ git clone https://github.com/onur/docs.rs.git docs.rs
63
+ cd docs.rs
64
+ vagrant up # This may take a little while on the first run
65
+ ```
66
+
67
+ You can always run ` vagrant provision ` to reconfigure virtual machine.
68
+ Provision will install required dependencies and latest version of nightly
69
+ into virtual machine. It will also configure lxc-container inside
70
+ virtual machine.
71
+
72
+ ### CLI
73
+
74
+ Make sure you are running every listed command inside ` /vagrant ` directory
75
+ of virtual machine. You can connect to virtual machine with ` vagrant ssh ` and
76
+ switch to cwd with: ` cd /vagrant ` inside virtual machine.
77
+
78
+ You can get a full list of commands with ` cargo run -- --help ` .
79
+
80
+ #### Starting web server
81
+
82
+ This command will start web interface of docs.rs and you can access it from:
83
+ ` http://localhost:3000/ `
84
+
85
+ ```
86
+ cargo run -- start-web-server
87
+ ```
88
+
89
+
90
+ #### ` build ` subcommand
91
+
92
+ ``` sh
93
+ # Builds <CRATE_NAME> <CRATE_VERSION> and adds it into database
94
+ # This is the main command to build and add a documentation into docs.rs.
95
+ cargo run -- build crate < CRATE_NAME> < CRATE_VERSION>
96
+
97
+ # Adds essential files (css and fonts) into database to avoid duplication
98
+ # This command needs to be run after each rustc update
99
+ cargo run -- build add-essential-files
100
+
101
+ # Builds every crate adds them into database
102
+ # (beware: this may take months to finish)
103
+ cargo run -- build world
104
+ ```
105
+
106
+
107
+ #### Database operations
108
+
109
+ ```
110
+ # Initializes database. Currently, only creates tables in database.
111
+ cargo run -- database init
112
+
113
+ # Adds a directory into database to serve with `staticfile` crate.
114
+ cargo run -- database add-directory <DIRECTORY> [PREFIX]
115
+
116
+ # Updates github stats for crates.
117
+ # You need to set CRATESFYI_GITHUB_USERNAME, CRATESFYI_GITHUB_ACCESSTOKEN
118
+ # environment variables in order to run this command.
119
+ # You can define them in ~/.cratesfyi.env file.
120
+ cargo run -- database update-github-fields
121
+
122
+ # Updates release activitiy
123
+ cargo run -- database update-release-activity
124
+ ```
125
+
126
+
127
+ #### ` doc ` subcommand
128
+
129
+ This subcommand will only build documentation of a crate.
130
+ This subcommand is designed to run inside a container.
131
+
132
+ ```
133
+ cargo run -- doc <CRATE_NAME>
134
+ ```
135
+
136
+
50
137
#### Contributors
51
138
52
139
* [ Onur Aslan] ( https://github.com/onur )
0 commit comments