Skip to content

Commit 0a558f0

Browse files
authored
Merge pull request #1344 from dsyme/fix-docs
add ResolutionFolder=__SOURCE_DIRECTORY__ to docs
2 parents 6f74e8b + 75b0511 commit 0a558f0

13 files changed

Lines changed: 38 additions & 35 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ Although this project is hosted in the [fsharp](https://github.com/fsharp) repos
5151

5252
[1]: https://github.com/fsharp/FSharp.Data/blob/master/LICENSE.md
5353
[2]: https://github.com/fsharp/FSharp.Data/tree/master/docs/content
54-
[3]: http://fsharp.github.io/FSharp.Data/
54+
[3]: http://fsprojects.github.io/FSharp.Data/

docs/content/ja/library/CsvProvider.fsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Yahoo FinanceのWebサイトでは以下のような構造のCSV形式で
4141
静的に型付けされた方法でファイルの内容を参照できるようになります:
4242
*)
4343

44-
type Stocks = CsvProvider<"../../data/MSFT.csv">
44+
type Stocks = CsvProvider<"../../data/MSFT.csv", ResolutionFolder=__SOURCE_DIRECTORY__>
4545

4646
(**
4747
生成された型にはデータをロードするための2つのstaticメソッドがあります。
@@ -142,7 +142,7 @@ Chart.Candlestick(recent).WithYAxis(Min = 40.0, Max = 50.0)
142142
`GetSample` メソッドを使っていることに注意してください。
143143
*)
144144

145-
let small = CsvProvider<"../../data/SmallTest.csv">.GetSample()
145+
let small = CsvProvider<"../../data/SmallTest.csv", ResolutionFolder=__SOURCE_DIRECTORY__>.GetSample()
146146

147147
(**
148148
先ほどの例と同じく、行データは値 `small``Rows` プロパティで取得できます。
@@ -178,7 +178,7 @@ CSVの列区切り文字には代わりにセミコロン( `;` )が使われま
178178
以下では区切り文字として `;` を使っています:
179179
*)
180180

181-
let airQuality = CsvProvider<"../../data/AirQuality.csv", ";">.GetSample()
181+
let airQuality = CsvProvider<"../../data/AirQuality.csv", ";", ResolutionFolder=__SOURCE_DIRECTORY__>.GetSample()
182182

183183
for row in airQuality.Rows do
184184
if row.Month > 6 then
@@ -201,7 +201,7 @@ for row in airQuality.Rows do
201201
末尾に構造化されていないデータが追加されています):
202202
*)
203203

204-
let mortalityNy = CsvProvider<"../../data/MortalityNY.tsv", IgnoreErrors=true>.GetSample()
204+
let mortalityNy = CsvProvider<"../../data/MortalityNY.tsv", IgnoreErrors=true, ResolutionFolder=__SOURCE_DIRECTORY__>.GetSample()
205205

206206
// 原因名をコードで検索
207207
// (事故で負傷した自転車走者)
@@ -220,7 +220,7 @@ for r in mortalityNy.Rows do
220220
これはたとえばファイルが不正で、セミコロンかコロンのどちらかで
221221
行が区切られているような場合に有効です。
222222
具体的には
223-
`CsvProvider<"../../data/AirQuality.csv", Separator=";,">`
223+
`CsvProvider<"../../data/AirQuality.csv", Separator=";,", ResolutionFolder=__SOURCE_DIRECTORY__>`
224224
というようにします。
225225
226226
## 値無し
@@ -350,7 +350,7 @@ for row in csv.Rows do
350350
351351
*)
352352

353-
let titanic1 = CsvProvider<"../../data/Titanic.csv", Schema=",,Passenger Class,,,float">.GetSample()
353+
let titanic1 = CsvProvider<"../../data/Titanic.csv", Schema=",,Passenger Class,,,float", ResolutionFolder=__SOURCE_DIRECTORY__>.GetSample()
354354
for row in titanic1.Rows do
355355
printfn "%s Class = %d Fare = %g" row.Name row.``Passenger Class`` row.Fare
356356

@@ -360,7 +360,7 @@ for row in titanic1.Rows do
360360
361361
*)
362362

363-
let titanic2 = CsvProvider<"../../data/Titanic.csv", Schema="Fare=float,PClass->Passenger Class">.GetSample()
363+
let titanic2 = CsvProvider<"../../data/Titanic.csv", Schema="Fare=float,PClass->Passenger Class", ResolutionFolder=__SOURCE_DIRECTORY__>.GetSample()
364364
for row in titanic2.Rows do
365365
printfn "%s Class = %d Fare = %g" row.Name row.``Passenger Class`` row.Fare
366366

docs/content/ja/library/JsonProvider.fsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ for item in Values.GetSamples() do
172172
型を生成した後、同じファイルを読み込んでいます:
173173
*)
174174

175-
type WorldBank = JsonProvider<"../../data/WorldBank.json">
175+
type WorldBank = JsonProvider<"../../data/WorldBank.json", ResolutionFolder=__SOURCE_DIRECTORY__>
176176
let doc = WorldBank.GetSample()
177177

178178
(**
@@ -226,7 +226,7 @@ for record in doc.Array do
226226
227227
*)
228228

229-
type Tweet = JsonProvider<"../../data/TwitterStream.json", SampleIsList=true>
229+
type Tweet = JsonProvider<"../../data/TwitterStream.json", SampleIsList=true, ResolutionFolder=__SOURCE_DIRECTORY__>
230230
let text = (*[omit:(omitted)]*)""" {"in_reply_to_status_id_str":null,"text":"\u5927\u91d1\u6255\u3063\u3066\u904a\u3070\u3057\u3066\u3082\u3089\u3046\u3002\u3082\u3046\u3053\u306e\u4e0a\u306a\u3044\u8d05\u6ca2\u3002\u3067\u3082\uff0c\u5b9f\u969b\u306b\u306f\u305d\u306e\u8d05\u6ca2\u306e\u672c\u8cea\u3092\u6e80\u55ab\u3067\u304d\u308b\u4eba\u306f\u9650\u3089\u308c\u3066\u308b\u3002\u305d\u3053\u306b\u76ee\u306b\u898b\u3048\u306a\u3044\u968e\u5c64\u304c\u3042\u308b\u3068\u304a\u3082\u3046\u3002","in_reply_to_user_id_str":null,"retweet_count":0,"geo":null,"source":"web","retweeted":false,"truncated":false,"id_str":"263290764686155776","entities":{"user_mentions":[],"hashtags":[],"urls":[]},"in_reply_to_user_id":null,"in_reply_to_status_id":null,"place":null,"coordinates":null,"in_reply_to_screen_name":null,"created_at":"Tue Oct 30 14:46:24 +0000 2012","user":{"notifications":null,"contributors_enabled":false,"time_zone":"Tokyo","profile_background_color":"FFFFFF","location":"Kodaira Tokyo Japan","profile_background_tile":false,"profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/1172376796\/70768_100000537851636_3599485_q_normal.jpg","default_profile_image":false,"follow_request_sent":null,"profile_sidebar_fill_color":"17451B","description":"KS(Green62)\/WasedaUniv.(Schl Adv Sci\/Eng)\/SynBio\/ChronoBio\/iGEM2010-2012\/Travel\/Airplane\/ \u5bfa\u30fb\u5ead\u3081\u3050\u308a","favourites_count":17,"screen_name":"Merlin_wand","profile_sidebar_border_color":"000000","id_str":"94788486","verified":false,"lang":"ja","statuses_count":8641,"profile_use_background_image":true,"protected":false,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/1172376796\/70768_100000537851636_3599485_q_normal.jpg","listed_count":31,"geo_enabled":true,"created_at":"Sat Dec 05 13:07:32 +0000 2009","profile_text_color":"000000","name":"Marin","profile_background_image_url":"http:\/\/a0.twimg.com\/profile_background_images\/612807391\/twitter_free1.br.jpg","friends_count":629,"url":null,"id":94788486,"is_translator":false,"default_profile":false,"following":null,"profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/612807391\/twitter_free1.br.jpg","utc_offset":32400,"profile_link_color":"ADADAD","followers_count":426},"id":263290764686155776,"contributors":null,"favorited":false} """(*[/omit]*)
231231
let tweet = Tweet.Parse(text)
232232

@@ -252,7 +252,7 @@ printfn "%s (%d 回リツイートされました)\n:%s"
252252
*)
253253

254254
// GitHub.json downloaded from https://api.github.com/repos/fsharp/FSharp.Data/issues to prevent rate limit when generating these docs
255-
type GitHub = JsonProvider<"../../data/GitHub.json">
255+
type GitHub = JsonProvider<"../../data/GitHub.json", ResolutionFolder=__SOURCE_DIRECTORY__>
256256

257257
let topRecentlyUpdatedIssues =
258258
GitHub.GetSamples()

docs/content/ja/library/XmlProvider.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ let authors = """
145145
データ内の情報を表示することができます:
146146
*)
147147

148-
type Authors = XmlProvider<"../../data/Writers.xml">
148+
type Authors = XmlProvider<"../../data/Writers.xml", ResolutionFolder=__SOURCE_DIRECTORY__>
149149
let topic = Authors.Parse(authors)
150150

151151
printfn "%s" topic.Topic
@@ -190,7 +190,7 @@ for author in topic.Authors do
190190
このような場合には引数 `Global``true` を指定します:
191191
*)
192192

193-
type Html = XmlProvider<"../../data/HtmlBody.xml", Global=true>
193+
type Html = XmlProvider<"../../data/HtmlBody.xml", Global=true, ResolutionFolder=__SOURCE_DIRECTORY__>
194194
let html = Html.GetSample()
195195

196196
(**

docs/content/library/CsvProvider.fsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ and the next rows define the data. We can pass reference to the file to `CsvProv
3636
get a strongly typed view of the file:
3737
*)
3838

39-
type Stocks = CsvProvider<"../data/MSFT.csv">
39+
type Stocks = CsvProvider<"../data/MSFT.csv", ResolutionFolder=__SOURCE_DIRECTORY__>
4040

4141
(**
4242
The generated type provides two static methods for loading data. The `Parse` method can be
@@ -127,13 +127,13 @@ a static argument. Also note that in this case we're using the same data at runt
127127
so we use the `GetSample` method instead of calling `Load` and passing the same parameter again.
128128
*)
129129

130-
let small = CsvProvider<"../data/SmallTest.csv">.GetSample()
130+
let small = CsvProvider<"../data/SmallTest.csv", ResolutionFolder=__SOURCE_DIRECTORY__>.GetSample()
131131

132132
(**
133133
We can also use the default constructor instead of the `GetSample` static method:
134134
*)
135135

136-
let small2 = new CsvProvider<"../data/SmallTest.csv">()
136+
let small2 = new CsvProvider<"../data/SmallTest.csv", ResolutionFolder=__SOURCE_DIRECTORY__>()
137137

138138
(**
139139
but the VisualStudio IntelliSense for the type provider parameters doesn't work when we use a default
@@ -167,7 +167,7 @@ where you can specify what to use as separator. This means that you can consume
167167
any textual tabular format. Here is an example using `;` as a separator:
168168
*)
169169

170-
type AirQuality = CsvProvider<"../data/AirQuality.csv", ";">
170+
type AirQuality = CsvProvider<"../data/AirQuality.csv", ResolutionFolder=__SOURCE_DIRECTORY__, ";">
171171

172172
let airQuality = new AirQuality()
173173

@@ -187,7 +187,7 @@ we also set `IgnoreErrors` static parameter to `true` so that lines with incorre
187187
are automatically skipped (the sample file ([`data/MortalityNY.csv`](../data/MortalityNY.tsv)) contains additional unstructured data at the end):
188188
*)
189189

190-
let mortalityNy = CsvProvider<"../data/MortalityNY.tsv", IgnoreErrors=true>.GetSample()
190+
let mortalityNy = CsvProvider<"../data/MortalityNY.tsv", IgnoreErrors=true, ResolutionFolder=__SOURCE_DIRECTORY__>.GetSample()
191191

192192
// Find the name of a cause based on code
193193
// (Pedal cyclist injured in an accident)
@@ -205,7 +205,7 @@ for r in mortalityNy.Rows do
205205
Finally, note that it is also possible to specify multiple different separators
206206
for the `CsvProvider`. This might be useful if a file is irregular and contains
207207
rows separated by either semicolon or a colon. You can use:
208-
`CsvProvider<"../data/AirQuality.csv", Separator=";,">`.
208+
`CsvProvider<"../data/AirQuality.csv", Separator=";,", ResolutionFolder=__SOURCE_DIRECTORY__>`.
209209
210210
## Missing values
211211
@@ -319,7 +319,8 @@ the other columns blank in the schema (you also don't need to add all the traili
319319
*)
320320
type Titanic1 =
321321
CsvProvider<"../data/Titanic.csv",
322-
Schema=",,Passenger Class,,,float">
322+
Schema=",,Passenger Class,,,float",
323+
ResolutionFolder=__SOURCE_DIRECTORY__>
323324

324325
let titanic1 = Titanic1.GetSample()
325326
for row in titanic1.Rows do
@@ -333,7 +334,8 @@ Alternatively, you can rename and override the type of any column by name instea
333334
*)
334335
type Titanic2 =
335336
CsvProvider<"../data/Titanic.csv",
336-
Schema="Fare=float,PClass->Passenger Class">
337+
Schema="Fare=float,PClass->Passenger Class",
338+
ResolutionFolder=__SOURCE_DIRECTORY__>
337339

338340
let titanic2 = Titanic2.GetSample()
339341
for row in titanic2.Rows do

docs/content/library/HtmlProvider.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Usually with HTML files headers are demarked by using the <th> tag, however in t
3535
first row is headers. (This behaviour is likely to get smarter in later releases). But it highlights a general problem about HTML's strictness.
3636
*)
3737

38-
type F1_2017 = HtmlProvider<"../data/2017_F1.htm">
38+
type F1_2017 = HtmlProvider<"../data/2017_F1.htm", ResolutionFolder=__SOURCE_DIRECTORY__>
3939

4040
(**
4141
The generated type provides a type space of tables that it has managed to parse out of the given HTML Document.

docs/content/library/JsonProvider.fsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ The following sample generates type based on the [`data/WorldBank.json`](../data
163163
file and loads it:
164164
*)
165165

166-
type WorldBank = JsonProvider<"../data/WorldBank.json">
166+
type WorldBank = JsonProvider<"../data/WorldBank.json", ResolutionFolder=__SOURCE_DIRECTORY__>
167167
let doc = WorldBank.GetSample()
168168

169169
(** Note that we can also load the data directly from the web both in the `Load` method and in
@@ -208,7 +208,7 @@ provider that the sample is actually a _list of samples_:
208208
209209
*)
210210

211-
type Tweet = JsonProvider<"../data/TwitterStream.json", SampleIsList=true>
211+
type Tweet = JsonProvider<"../data/TwitterStream.json", SampleIsList=true, ResolutionFolder=__SOURCE_DIRECTORY__>
212212
let text = (*[omit:(omitted)]*)""" {"in_reply_to_status_id_str":null,"text":"\u5927\u91d1\u6255\u3063\u3066\u904a\u3070\u3057\u3066\u3082\u3089\u3046\u3002\u3082\u3046\u3053\u306e\u4e0a\u306a\u3044\u8d05\u6ca2\u3002\u3067\u3082\uff0c\u5b9f\u969b\u306b\u306f\u305d\u306e\u8d05\u6ca2\u306e\u672c\u8cea\u3092\u6e80\u55ab\u3067\u304d\u308b\u4eba\u306f\u9650\u3089\u308c\u3066\u308b\u3002\u305d\u3053\u306b\u76ee\u306b\u898b\u3048\u306a\u3044\u968e\u5c64\u304c\u3042\u308b\u3068\u304a\u3082\u3046\u3002","in_reply_to_user_id_str":null,"retweet_count":0,"geo":null,"source":"web","retweeted":false,"truncated":false,"id_str":"263290764686155776","entities":{"user_mentions":[],"hashtags":[],"urls":[]},"in_reply_to_user_id":null,"in_reply_to_status_id":null,"place":null,"coordinates":null,"in_reply_to_screen_name":null,"created_at":"Tue Oct 30 14:46:24 +0000 2012","user":{"notifications":null,"contributors_enabled":false,"time_zone":"Tokyo","profile_background_color":"FFFFFF","location":"Kodaira Tokyo Japan","profile_background_tile":false,"profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/1172376796\/70768_100000537851636_3599485_q_normal.jpg","default_profile_image":false,"follow_request_sent":null,"profile_sidebar_fill_color":"17451B","description":"KS(Green62)\/WasedaUniv.(Schl Adv Sci\/Eng)\/SynBio\/ChronoBio\/iGEM2010-2012\/Travel\/Airplane\/ \u5bfa\u30fb\u5ead\u3081\u3050\u308a","favourites_count":17,"screen_name":"Merlin_wand","profile_sidebar_border_color":"000000","id_str":"94788486","verified":false,"lang":"ja","statuses_count":8641,"profile_use_background_image":true,"protected":false,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/1172376796\/70768_100000537851636_3599485_q_normal.jpg","listed_count":31,"geo_enabled":true,"created_at":"Sat Dec 05 13:07:32 +0000 2009","profile_text_color":"000000","name":"Marin","profile_background_image_url":"http:\/\/a0.twimg.com\/profile_background_images\/612807391\/twitter_free1.br.jpg","friends_count":629,"url":null,"id":94788486,"is_translator":false,"default_profile":false,"following":null,"profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/612807391\/twitter_free1.br.jpg","utc_offset":32400,"profile_link_color":"ADADAD","followers_count":426},"id":263290764686155776,"contributors":null,"favorited":false} """(*[/omit]*)
213213
let tweet = Tweet.Parse(text)
214214

@@ -231,7 +231,7 @@ Let's start by listing the 5 most recently updated open issues in the FSharp.Dat
231231
// GitHub.json downloaded from
232232
// https://api.github.com/repos/fsharp/FSharp.Data/issues
233233
// to prevent rate limit when generating these docs
234-
type GitHub = JsonProvider<"../data/GitHub.json">
234+
type GitHub = JsonProvider<"../data/GitHub.json", ResolutionFolder=__SOURCE_DIRECTORY__>
235235

236236
let topRecentlyUpdatedIssues =
237237
GitHub.GetSamples()
@@ -300,7 +300,8 @@ project file). If you are building a library `MyLib.dll`, you can write:
300300
301301
*)
302302
type WB = JsonProvider<"../data/WorldBank.json",
303-
EmbeddedResource="MyLib, MyLib.data.worldbank.json">
303+
EmbeddedResource="MyLib, MyLib.data.worldbank.json",
304+
ResolutionFolder=__SOURCE_DIRECTORY__>
304305

305306
(**
306307
You still need to specify the local path, but this is only used when compiling `MyLib.dll`.

docs/content/library/WorldBank.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ a number of static parameters. If the `Asynchronous` parameter is set to `true`
7272
type provider generates all operations as asynchronous:
7373
*)
7474

75-
type WorldBank = WorldBankDataProvider<"World Development Indicators", Asynchronous=true>
75+
type WorldBank = WorldBankDataProvider<"World Development Indicators", Asynchronous=true, ResolutionFolder=__SOURCE_DIRECTORY__>
7676
WorldBank.GetDataContext()
7777

7878
(**

docs/content/library/XmlProvider.fsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ The `Load` and `AsyncLoad` methods allows reading the data from a file or from a
129129
`Parse` method takes the data as a string, so we can now print the information as follows:
130130
*)
131131

132-
type Authors = XmlProvider<"../data/Writers.xml">
132+
type Authors = XmlProvider<"../data/Writers.xml", ResolutionFolder=__SOURCE_DIRECTORY__>
133133
let topic = Authors.Parse(authors)
134134

135135
printfn "%s" topic.Topic
@@ -170,7 +170,7 @@ that processes `<div>` elements. To make this possible, you need to set an optio
170170
parameter `Global` to `true`:
171171
*)
172172

173-
type Html = XmlProvider<"../data/HtmlBody.xml", Global=true>
173+
type Html = XmlProvider<"../data/HtmlBody.xml", Global=true, ResolutionFolder=__SOURCE_DIRECTORY__>
174174
let html = Html.GetSample()
175175

176176
(**
@@ -233,7 +233,7 @@ to infer the schema correctly. For example, the first level `<dct:dataset>` elem
233233
least twice for the provider to infer the `Datasets` array rather than a single `Dataset` object.
234234
*)
235235

236-
type Census = XmlProvider<"../data/Census.xml">
236+
type Census = XmlProvider<"../data/Census.xml", ResolutionFolder=__SOURCE_DIRECTORY__>
237237

238238
let data = Census.Load("https://api.census.gov/data.xml")
239239

nuget/FSharp.Data.3.0.1.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<authors>Tomas Petricek, Gustavo Guerra, Colin Bull</authors>
88
<owners>Tomas Petricek, Gustavo Guerra, Colin Bull</owners>
99
<licenseUrl>http://github.com/fsharp/FSharp.Data/blob/master/LICENSE.md</licenseUrl>
10-
<projectUrl>http://fsharp.github.io/FSharp.Data</projectUrl>
10+
<projectUrl>http://fsprojects.github.io/FSharp.Data</projectUrl>
1111
<iconUrl>https://raw.github.com/fsharp/FSharp.Data/master/misc/logo.png</iconUrl>
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1313
<summary>Library of F# type providers and data access tools</summary>

0 commit comments

Comments
 (0)